The web applications I produce often involve uploading many large-sized files at once. Due to browser limitations (which currently limit file selection to one at a time) I use a Flash component to allow users to batch upload files. This is a huge improvement for both usability and performance.
The newest version, Flash Player 10, contains some security-related changes which have significantly impacted the capabilities of Flash with respect to file uploading. The method which allows a user to select multiple files for upload, FileReferenceList.browse, can now be called only from within an ActionScript function that is the result of a user-initiated action, such as a mouse-click or keypress.1 Justin Everett-Church (Senior Product Manager for Flash Player) discussed the reasons for the change in a recent interview with Lee Brimelow.
Essentially this means JavaScript can no longer be used to trigger FileReferenceList.browse via ExternalInterface — the request to open the file dialog must originate from within Flash (bummer). As a result, widgets like SWFUpload need to be updated to accomodate the new restrictions. SWFUpload v2.2.0 Beta 2 was released a few days ago and thankfully provides an easy, albeit ugly, workaround which renders a button in Flash for the user to click. Because the call to FileReferenceList.browse now originates in Flash, the method succeeds and everything works as expected.
One thing to note is that uploaders built entirely in Flash will remain unaffected by this change. The uploader for Parade was built purely in Flash, and it’s been verified to work in Flash 10. fotojournal and Parade V2, however, both required the upgrade to SWFUpload 2.2.
This was quite a pretty annoying issue to identify because Firebug was reporting JavaScript errors originating in jquery.js —I should have guessed it was something else, being that jQuery never breaks :)
Anyway, it sounds like I’m not the only one annoyed by this change, and I’m surprised I haven’t heard of this issue until now. WordPress uses SWFUpload, and it appears discussion regarding discontent with Adobe & Flash started months ago and is still going. I might look into using Google Gears, but in the meantime I think I’ll just stick with Flash.
Has anyone else run into this issue, or come up with a clever alternative?
Leave a comment