Large File Uploads

| | August 5, 2015

Do large file uploads block an applications request/response cycle? I have an app that allows users to upload multiple large files (images in particular). These files are stored on a remote host. I cannot use async background jobs to upload these images as these have to be immediately accessible to the user once the upload finishes. How best should i handle such large uploads? Does it affect concurrency? This is my first time with uploads on a large scale. What should i be wary of other than the huge bills of course? Any input from developers who have created apps which use large file uploads will be greatly appreciated.

2 Responses to “Large File Uploads”

  1. It’s an old question but still, I was worried about the same problem with large files uploads thinking that the processes get blocked while the file is getting uploaded but it turned out, if I got it right, that the nginx and probably other servers as well buffer the content of the file while its being sent so no rails processes get blocked, only when the upload is finished and rails is processing it, like resizing images or something.

  2. Why can’t you use an async upload, and just handle the event that signifies that it’s done? That’s generally how async operations work – you kick them off and then store the pointer somewhere, and then either handle the “Complete” event, or just periodically iterate through he pointers for uploads you’ve started and check each one to see if it’s complete.

Leave a Reply