I have a flex app that uploads files to a server. The server requires authentication to be able to upload. In IE the upload works fine. However in FF and Safari, it does not upload. I have seen people all over with this same problem but no answers. Don’t fail me now stackoverflowers.
Share
I found this question while trying to find the answer myself. The solution was rather simple.
Based on the flash player bug that others have linked, and the comments on that page, I decided to append session identifiers to my upload URL and give it a shot. It really was that easy!
To make it work, I started by adding a flashVar parameter called sessionParams. This allowed me to pass any string I want in to the flash player as my session identifier, and it will later get appended to the URL used to upload.
In my case, I’m on ColdFusion with java sessions enabled, so my
sessionParamsare setup like the following before being passed into the flash player:Don’t forget to escape special characters like =,&, etc (which I’ve done with urlEncodedFormat), so that they are treated as part of the value of the ‘sessionParams’ parameter, and not breakpoints to indicate other parameters. You’re embedding future-URL information in the current URL.
Then, use the sessionParams value in your upload code. Here’s a snippet of how I set mine up:
The variable names are different (but similar) because this is part of a reusable class.
Hopefully that helps you. If not, let me know and I’ll try to provide more code or explanation to help you out.