1 person found this helpful
You may need to use a proxy server.
Thanks a lot for your answer!
However, could you be a bit more precise? Do you suggest specific server software?
Do you also know what is causing this issue? I mean, uploading an image to a PHP script, everything running on the same server... what's more trivial? Since it seems to bug (well, not sure if it's a bug...) on both my home test server and the production server, I guess there's something I'm missing, or there's a feature Flex is missing...
I've tried to understand this issue, and the only thing that seems to make sense to me is the "sandbox" being way too strict regarding file upload http requests...
However, I'm still looking for an explanation/solution to the mentioned issue. Because the HTML-way is just a temporary solution.
Thanks in advance for any assistance.
I think the security rules are such that a Flash SWF cannot upload a file
from a different domain w/o user permission and/or a crossdomain.xml file.
Otherwise, I would publish a popular game or facebook app that would try to
upload random URLs to my server and maybe steal a valuable photo of a
top-secret project. The Flash SWF is running inside the firewall so it
needs more restrictions.
A proxy server would probably be a service on your server where you send it
a URL and it goes and gets it. Then it is outside the firewall if there is
There are plenty of posts on proxy servers.
Thank you for your answer. It looks like a crossdomain.xml is needed for cross-domain communication indeed, but my application does not need cross-domain communication! Everything is running on the same server. The folders have been chmod'ed correctly (proof: I can upload through a simple HTML form).
So I still have trouble understanding what's going wrong...
As I think I've mentioned before, I can upload on my local test server when I'm running the application locally (that is, with an address starting with file:// ). When I execute the Flex application through its http:// address (in my case: http://localhost/.... ), or when I upload it to the production server, it looks like file uploading is disabled. Even for small 20kB files! And regular (POST and GET) HTTP requests are working!
Thanks again for the reactions, any assistance is greatly appreciated.
It isn't about size or file attributes, it is about security. When you run
from file:// you have different security rules. We relax restrictions
assuming you are doing development and/or trust the supplier of the SWF.
When running from http:// security rules are tight. The SWF is running
inside your firewall so we can't let you upload foreign content, otherwise I
would steal images off internal servers. You can set up trust files/change
settings if you trust the SWF.