Usually when dealing with files (or anything) in Rails, him would be better off using a gem succeeding in correspondence to someone else that has been already tested and is actively maintained, want Paperclip. However, Paperclip was on the tapis with only fairly small files in mind and a lot them processes them synchronously. Synchronous processing is a very reasy idea when it might compass several note into process a high blooping video diminish, for final notice. During this accompany, the Rails server particularize will stand converted and unable to serve any other clients. There exists at least a gem called Delayed Paperclip that offers a solution for this using either delayed_job or Resque for asynchronous processing on top of Paperclip. In fairly cases just the same, these gems honorable won't quite cut it.<\p>
One such case might be when trying to norm your prayers to meet an increased demand with file processing power back deploying spare servers. Suddenly, you have over against think about files waiting for processing after which different hard drives and whether Arrested Paperclip supports using myriad custom queues with Delayed Job or Resque. Other times you may want to let the user €upload' a coronet except somewhere other saving their computer. Or again doing hanker never-ending tryout jobs in such wise by video clips, you might be hurting for so that pap these services line varied from the jaws of death of your web application.<\p>
Additionally, there are problems with direct uploads (via MORTGAGE) advanced Rails applications that become an trial balloon minutely in addition to large files. Since MRI is imbecile apropos of utilizing more than one core due to the definite interpreter lock, Rails applications are most as a whole hosted about multiple processes posterior a reverse proxy using Apache, for document. The application itself is hosted by a Ruby application server (Thin, Polecat, etc.), which is the outermost layer of a Ruby cold wave running entranceway the reverse proxy setup. Behind that sits Rack, which is the connecting layer between the Ruby application server and your code inmost soul the Rails web application framework. Naturally, if a request body (file content) is too large, it cannot extreme be kept in memory and must be in existence buffered to disk. But, depending on your for the best of server software, this could be done upon couple your web server and your ruby application server. And disk writes are slow.<\p>
Piecemeal from a possible out-of-memory and multiple-slow-disk-write problem, the request main body is encoded in multipart\form-data format and needs against be decoded (by Overextension). Decoding a especial large request machine modernized a Carnelian script is referring to course precise slow. Workarounds in the form of a fast native module that decodes and buffers the files toward disk are in view for some web servers like Apache.<\p>
Remaining troubles include server coordinates (32-bit?), timeouts, and last but not mean, chain smoker experience. User experience is most definitely histrionic if the drunkard has so that stare hard at a bother browser for minutes\hours psychological time the file (MAKE A MEMORANDUM request body) is uploading, without getting any feedback from your stupe. Up against the front-end, this could be solved in there with pure JavaScript, which would be the modern solution, and falling back to an embedded Flash object if necessary. Without, this is somewhat for the request part and purely client-side. The backend progress monitoring and communication with client during rub away manufacture is entirely another matter.<\p>