Eliminating the need for proprietary technologies

Dec 15, 2009 11:48 GMT  ·  By
The File API support in Firefox 3.6 eliminates the need for proprietary technologies
   The File API support in Firefox 3.6 eliminates the need for proprietary technologies

One of the more interesting new features to make its way into the upcoming Firefox 3.6 is support for the latest W3C File API for HTML and also for the Drag and Drop API from the proposed HTML 5 standard. With these two APIs web developers can create powerful app for file management without resorting to proprietary plugins and technologies for the more advanced functionality. For example, it will allow developers to enable users to upload multiple files, asynchronously, at one time even by just dragging them over the web page.

“Firefox 3.6 now supports much of the W3C File API, which specifies the ability to asynchronously read the selected file into memory, and perform operations on the file data within the web application (for example, to display a thumbnail preview of an image, before it is uploaded, or to look for ID3 tags within an MP3 file, or to look for EXIF data in JPEG files, all on the client side),” Mozilla's Arun Ranganathan wrote introducing the feature.

Mozilla gets into the technical aspects of the functionality with an overview of the basic features complete with code samples. The most common application for the File API is for upload tools, a no-brainer really, but also more interesting uses can be implemented like the possibility to display a thumbnail of a photo before being uploaded or extracting various information from files locally.

Another very important functionality enabled by the new File API is multiple file support. This feature is crucial and is widely used in a huge variety of services and sites. Up till now, using standard web technologies, the files had to be handled one at a time, meaning that users had to use the file “picker” and then browse to the location of the file and select it for each and every one they wanted to upload. This worked for a couple of files, but it was a huge hassle for a bigger number. Many web developers got around this either by using proprietary technologies like Flash or even Java and more recently using Ajax and the likes. Now, all this becomes unnecessary as the functionality is supported in the HTML standard.

Finally, users can now avoid the file picker altogether thanks to the file drag and drop functionality built into Firefox 3.6. They'll be able to simply drag the files they want uploaded over the web page or a selected region and web developers will be able to implement functionality to handle the event. You can test the functionality yourself here, but you're going to need a recent beta build of Firefox 3.6. What's more, users aren't restricted to dragging just one file making the entire process a lot less painful and more streamlined, something web apps need to start doing as soon as possible if they want to replace desktop apps any time soon.

Firefox 3.6 Beta 4 for Windows is available for download here. Firefox 3.6 Beta 4 for Mac OS X is available for download here. Firefox 3.6 Beta 4 for Linux is available for download here.

File API in Firefox 3.6 demo

Drag and Drop demo