Linux Flash Player Bugs

As a user of Linux on the desktop (I use Ubuntu 7 on an HP nc8430 laptop), the release of a current version of the Flash Player for Linux was great news. As well as allowing me to look at the latest Flash web sites, it allowed me to develop and test content produced using the Flex SDK. Unfortunately there are a couple of annoying bugs in the player related to use of the FileReference class – the class that lets you upload files back to the server.

The first of these bugs relates to sending parameters back to the server at the same time as uploading the file. This is useful as it lets the page send back information that the user may have entered to be associated with the file, such as a title and description for the file. Normally you use the URLVariables class to add variables to the file, for example:

var fileRef:FileReference = new FileReference();
fileRef.browse();
// In handler for Event.SELECT
var params:URLVariables = new URLVariables();
params.title = "Sleeping Cat";
params.description = "My cat having a sleep on the patio.";
var request:URLRequest = new URLRequest("http://localhost:8080/FileUploadServlet");
request.method = URLRequestMethod.POST;
request.data = params;
fileRef.upload(request);

Now under Flash Player in Windows this works just fine – the parameters are encoded into the request and uploaded just as Adobe says they should be. Try it under Linux though, and you just get the uploaded file – no parameters sent. This is very annoying as it means I have to encode the information I want to sent differently if I want to support Linux, which I do or otherwise I won’t be able to see my own application.

The workaround that I have implemented is to put the parameters into the URL itself, eg:

var requestString:String = "http://localhost:8080/FileUploadServlet?title=" + title \\
 + "&description=" + description;
var request:URLRequest = new URLRequest(requestString);

This works fine in both Linux and Windows, although you may have to encode your parameters of course before creating the URL to avoid illegal characters in there.

But unfortunately that is not the only problem with FileReference in the Flash Player. Adobe introduced an event to UPLOAD_COMPLETE_DATA that allows you to get at any response from the server once your file is uploaded. This allows you to make your server-side code send a response back to the player, for example a reference number or even XML with more complex data, for example:

fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, fileUploadCompleteDataHandler);

…and then…

private function fileUploadCompleteDataHandler(event:DataEvent) : void
{
   Alert.show("File upload OK - response from server: " + event.data, "Debug");
}

This all sounds great, but unfortunately it doesn’t work under Linux either – although its just fine under the Windows player.

I’ve reported both of these issues to Adobe, so I hope that they get resolved soon. Sadly though it does make life more complex because of course so many people will have older versions of the Flash player that are broken. Fortunately I suspect Linux users are more amenable to upgrading, and of course the majority of users have Windows or OS/X.

4 Comments

  1. Thanks for this post. It confirms a day of debugging that I’ve been doing on Linux. Have you heard anything from Adobe about when this might be fixed?

    regards,

    david

  2. Hey,

    I stumbled upon the same bug today :$ Do you know if anything has been done and if I’m perhaps still using an old SDK? Cause this sure doesn’t make developing on Linux much easier 🙁

    Michiel.

  3. I’ve noticed the same problem as you. I was delevoping a file that would upload a pic into varying folders. On Windows it worked fine, under Linux the string variable that represented the destination folder was never sent to my php script and the file would just upload to the same direcory as the main swf.

    I also noticed another problem. My file was using a fileReferenceList and it would only upload one picture. I haven’t tested it enough but I think it was the last picture. I’m going to do some more testing to figure out exactly were the issue is. The files are bieng shown in the swf after being selected so I don’t think there is an issue with getting the array of files, but they aren’t being sent to the php script when they’re getting uploaded. The exact same page works flawlessly when I test it moments later in an XP VM using both FF and IE

  4. Hi,

    I’m having this very issue. I’ve read and started implementing the fix for the post string where the file is not uploaded, but have you made any progress or heard of anything for retrieving the UPLOAD_COMPLETE_DATA response?

    Please send me a line back if you get a change. It’s a pretty major issue that Adobe should address for us linux users.

    Cheers

    Kyle

Leave a Reply to Michiel Cancel reply

Your email address will not be published. Required fields are marked *