开发者

File read fails when using Delayed Job

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜