开发者

Uploading files to Rails App: 2 GB possible?

I need to write an application, which allows the user to upload large videos. Afaik, PHP stores the entire uploaded file into memory (at least per default), so you get problems with large files. Has Rails similar problems? I need to receive files up to 2 GB.

My setup will be:

Unless you recommend something else, I would give Paperclip a try.

Regards, Johannes


It's possible, and we have an commercial website which is currently handling uploads ~3GBs for long HD videos just fine with CarrierWave - a great alternative to Paperclip.

So long as you have Apache setup correctly to accept requests that large, you probably won't have the same issues that PHP applications and the like traditionally do with configuration hell needed to set the maximum request size and whatnot.

Read this for the caveats, though: http://www.therailsway.com/2009/4/23/uploading-files

Edit: For what it's worth, we're using Nginx + upload module (see https://github.com/vkholodkov/nginx-upload-module for info) to do this and avoid the issues in the above article; afaik Rails loads the entire uploaded file into memory when handling uploads normally, which means you're going to need to have a significant amount of memory unless you're using something like the mod_porter plugin mentioned in the above article.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜