The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

file upload mechanism

What mechanism do websites like Gmail, Facebook, Walmart Photo, etc use for uploading large files (from user to them)?
webbie
Monday, June 02, 2008
 
 
Multipart POST.
Most of the applications I've come across utilize the <input type="file"> element of a HTML form to enable users to post files to the server.

Depending on the language and framework that you're using, the server-side logic involves parsing the multipart POST request into actual binary content, which probably ends up in a database or a CMS.

Large file uploads normally involve a file size limit, primarily to prevent huge files from consuming too many resources, and also to prevent DoS attacks.
VR Send private email
Monday, June 02, 2008
 
 
The best upload mechanism I've seen is used by kijiji.com. It uses some sort of AJAX contraption to let you upload an image to the site. Once you select an image to upload it begins sending it asynchronously and adds a new input field in case you want to upload yet another file... you can upload multiple files simultaneously this way.

Still, I don't think this is a solved problem. Ideally we should be able to upload multiple files at once to the server asynchronously without reloading the page. It sucks having to select filenames one at a time instead of selecting multiple files and drag-n-dropping them.
Gili Send private email
Tuesday, June 03, 2008
 
 
Taking a look at Kijiji.com, will lead one to using iframes for handling file uploads in manner similar to AJAX.

The form is submitted with a target set to a hidden iframe. The response of the form submit is then populated in the iframe instead of updating the document that contained the original form.

One can find several examples online, to achieve an asynchronous file upload using iframes.
VR Send private email
Tuesday, June 03, 2008
 
 
Facebook uses a Java thing by default, which makes bulk uploads easier.
Robert Synnott Send private email
Thursday, June 26, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz