I’ve recently been evaluating mechanisms of doing bulk uploads through a Web browser, ie. without installing external software. This has involved me taking apart large amounts of other peoples’ code and trying to work out how they’ve done it.

Bulk uploads seem to fall into one of two camps:

  • Java applets: these tend to be largely ugly, slow, and seem hit-and-miss as to whether they will be supported on a user’s browser.
  • Flash applications: these tend to be overthought mashups but seem to work OK.

Both of course require plugins, which is something I’ve resigned myself to after working out that the level of control I require from this project excludes anything Javascript-y and AJAX-y.

Or so I thought. I spent a day this week taking apart three major ‘file sharing’ and ‘file hosting’ website uploaders, and was quite surprised to find that the technique preferred nowadays is a mashup of Flash and AJAX. Now Flash is something I’ve avoided for a long long time but with the release of Adobe Flash CS3 it’s got some nice hooks into Javascript which means you can use Flash’s own bits of file handling and uploading where Javascript simply won’t do. Add some AJAX into that equation and you’ve got quite a nice uploader which, granted it needs Flash, but means that you don’t have to diddle with the UI bits of it. Incidentally, this is how Flickr does it, with a fallback to a basic HTTP upload jobbie.

So why not Java? Well, I used Xcode on the Mac to write a very basic test applet using Swing, and got it working. Then I tested it under XP and Vista, noticing that I got the grey box of uninstalledness. That’s enough for me to want to ditch it.

If you’re still using Flash 8 by the way, there is a Flash/Javascript Integration Kit which doesn’t work under CS3 (but if you’re using Actionscript 3.0 then you should be using the ExternalInterface stuff anyway).