开发者

How can I send a file as a parameter from controller to model?

From a controller, is there a way to call a method in a model with a file as a parameter, without getting an uninitialized stream error when you try to use the received file in the model?

I am trying to use delayed_job to upload files to S3 (using Paperclip). I use Heroku, so any request will time out after 30 secs, and I want to allow mult开发者_运维知识库iple file uploads at once.

The same problem was talked about in the delayed_job Google Group, but there was never a solution.


You'll have to save the file locally first, or directly to S3 without going through the delayed job. Another option would be to have the user upload directly to S3 rather than going through your stack - this approach obviously has some other issues around authentication and the ability to screen the data first, but you could handle the data screening in your delayed job instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜