Rethinking the Media Database

Home

Multi-file flash uploading

Supporting documents

In brief

A multi-file uploading piece that transparently uses Flash as the upload mechanism, while using basic HTML/CSS for the display. It largely mimicks Flickr's upload mechanism.

Benefits of Flash uploading over Java uploading

The flash component is lightweight (68KB) and runs more quickly than its Java counterparts. It doesn't have to spawn certificate dialogs or security warnings.

Benefits of using an HTML display over a native Flash display

Using HTML as the interface (rather than a Java or Flash interface) allows us to more easily integrate the look and feel of the upload component into the rest of the site. It lets us leverage our existing HTML and CSS codebase. It also has the benefits of standard HTML (being able to resize and search the text, resize the display, etc...).

Technology

This example works using the JavaScript/Flash scripting bridge available from Adobe, the current developers of Flash. The JavaScript calls the hidden Flash file which pulls up the Browse dialog. When the user chooses his or her files, the results of the selection are sent back to JavaScript and the files are shown on the page. The user can then delete any files as appropriate. Then the user hits the "Upload files" link which tells Flash to upload the files to a specified script, in this case upload.php. The flash file periodically sends progress information back to JavaScript, which is used to display the percentage of the file uploaded. This can be easily expanded into a visually progress bar.

Statistics

The particular Flash technology used, FileReferenceList, was introduced in Flash 8, which has over 98% penetration in the US and Canada.

Notes

The PHP installation on this server currently has a cap of 2 MB (although it can be changed) for uploaded files. That said, the Flash component can easily point to a Perl script which, from my research, has a maximum limit of 32 MB per file (this can be artificially reduced). There is technically no limit on number of files that can be uploaded.

Files that are under 2 MB are uploaded here.

Example

Browse files (jpeg, png, gif, psd)
Upload files