BigUpload: Uploading really big files in the browser
I’ve been working on a web application which requires that the user be able to upload files through their browser. Because of the context of the application, some of these files will be pretty large.
Previously, the only way to handle file uploads larger than a few megabytes was to use flash or some other ugly plugin.
But with the HTML5 FileReader class, we can do it right in the browser.
BigUpload uses FileReader to split large files into manageable chunks, and then sends these chunks to the server one at a time using AJAX.
The PHP script then pieces these chunks together into one large file, and when the file is done uploading, moves and renames the finished file.
Because the chunks are all the same size, the script can calculate an accurate progress bar and report the time remaining with some accuracy. It can also easily pause, resume, or cancel in-progress uploads.
This tool is capable of handling file uploads of up to 2GB in size, without the need to tweak the max_upload and timeout variables for your server and without eating up all of your server’s memory trying to upload a 2GB file in one go.
It’s only supported on Chrome and Firefox, but falls back to a normal file upload form on other browsers.