Uploading files with Flash Player? Read the fine print…

Adobe has been disappointing me lately — first off are the Flash Player limitations I noticed on FileReference() and secondly by the lack of motivation and progress Adobe is making towards fixing these issues in the plugin. To elaborate, here is what I’m bitching about:

  • FileReference [upload] ( Quoted from the Flex 3 / AS3 lang ref ):
    “Note: If your server requires user authentication, only SWF files running in a browser — that is, using the browser plug-in or ActiveX control – can provide a dialog box to prompt the user for a username and password for authentication, and only for downloads. For uploads using the plug-in or ActiveX control, or for uploads and downloads using the stand-alone or external player, the file transfer fails.”

    Well, that certainly is limiting… so… authentication only works for downloading :( and even in that regard it sucks because the plugin has to prompt the user. Boo! A work-around solution: Pass a token or session-id to have the server authenticate the request. Or, setup a socket-server! lolz :D

  • FileReference [upload] ( Quoted from Flex 3 / AS3 lang ref ):
    “The FileReference.upload() and FileReference.download() methods do not support the URLRequest.requestHeaders parameter.”

    So, what they are saying is that not only does authentication not work for uploading through the plugin, but now even if I want to handle the authentication through Basic-Auth headers, I’m hosed there as well! see work-around above.

Here are the related bug tickets ( make sure to look at the creation time-stamps ):

https://bugs.adobe.com/jira/browse/FP-1044
http://bugs.adobe.com/jira/browse/FP-78
http://bugs.adobe.com/jira/browse/FP-201

BONUS!

(I might as well get this one off my chest before I sign off…)
  • HTTPStatusEvent [status] ( Quoted from Flex 3 / AS3 lang ref ):
    “If Flash Player or AIR cannot get a status code from the server, or if it cannot communicate with the server, the default value of 0 is passed to your code. A value of 0 can be generated in any player (for example, if a malformed URL is requested), and a value of 0 is always generated by the Flash Player plug-in when it is run in the following browsers, which do not pass HTTP status codes to the player: Netscape, Mozilla, Safari, Opera, and Internet Explorer for the Macintosh.” Lovely! So why not change this property to “HTTPStatusEvent.isOK” or something equally lame since its a pretty damn good chance you wont get back any other useful codes other than [200,201,500].

About John Pencola

Hello, my name is John Pencola. I can't get enough of exploring new technologies, discussing software principals, creating programs and having fun with interface design. I will share my experiences here and hope Liquid Language adds some useful information to the vast sea that is the web.
This entry was posted in ActionScript 3, Flex 3, Opinions and tagged , , , , , , . Bookmark the permalink.