开发者

File read fails when using Delayed Job

开发者 https://www.devze.com 2023-01-03 12:06 出处:网络
How to check that my params[\'Filedata\'] is corrupted or not? I have function it\'s reading file from pa开发者_如何学Pythonrams[\'Filedata\'] and writing it to the other file.

How to check that my params['Filedata'] is corrupted or not?

I have function it's reading file from pa开发者_如何学Pythonrams['Filedata'] and writing it to the other file.

File.open(upload_file, "wb") { |f| f.write(params['Filedata'].read) }

this line working fine for me..

But when i am calling this function with delayed job function send_later than I am getting error with params['Filedata'].read.


I'm guessing params['Filedata'] refers to a uploaded file.

Rails handles uploaded data as temporary files, which are deleted after the request is completed. If you want to access the file later, you need to copy it to a more permanent location.

0

精彩评论

暂无评论...
验证码 换一张
取 消