1

I know this problem has been asked ad nauseam; however, it would appear I'm stuck. I have created a file-uploader in Flash which has been successfully tested on a local machine. However, when moving it to the production server and trying to access it from another machine, the php isn't being called. Initially there were security exceptions being thrown but they've been resolved after creating the crossdomain.xml file.

I've placed some logging in the php file to see if it's called and no dice. It's called if run locally but like I said, cross-domain not so much.

My crossdomain.xml file looks like this as follows.

<?xml version="1.0"?>
<cross-domain-policy>
    <allow-access-from domain="*" />
</cross-domain-policy>

Is there something else I need to do in the configuration of either the Flash or on the server?

Cœur
  • 37,241
  • 25
  • 195
  • 267
ist_lion
  • 3,149
  • 9
  • 43
  • 73

2 Answers2

3

you could try the new crossdomain format:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="all"/>

  <!-- Place top level domain name -->
  <allow-access-from domain="*" />
  <allow-access-from domain="*" to-ports="80,443"/>
  <allow-http-request-headers-from domain="*" headers="*" />

</cross-domain-policy>
Philipp Kyeck
  • 18,402
  • 15
  • 86
  • 123
  • I'm unable to send a request from ie 8 to my server through flash. Even after applying this crossdomain.xml i'm unable to catch request on my server. Any idea why? – Varun Achar Feb 24 '12 at 20:05
  • do you get an error? try debugging the call with a proxy (like Charles Proxy) and look what the server's response is ... – Philipp Kyeck Feb 25 '12 at 07:30
  • A hit doesn't reach the server. Everything works perfectly on FF and Chrome. This is specific to when i'm sending image data using MultipartURLLoader for uploading images to server. [Here's](http://stackoverflow.com/q/9438046/652895) the complete explanation – Varun Achar Feb 25 '12 at 11:31
0

I am not fimiliar with flash, but I am developing some flex application, so I can give you my experience to deal with the crossdomain issue.

FlashPlayer is looking for the crossdomain.xml file in the URL domain root, e.g.

domain.com/crossdomain.xml

is where the FlashPlayer wants to find it. Therefore, you can load the crossdomain file by typing the above url.

However, you can use Security.loadPolicyFile(url) to load a crossdomain.xml file from an alternate location on the server.

You can try the following crossdomain.xml:

<?xml version="1.0"?> 
<!DOCTYPE cross-domain-policy SYSTEM “/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy> 
<site-control permitted-cross-domain-policies="all"/> 
<allow-access-from domain="*" to-ports="*" secure="false"/> 
<allow-http-request-headers-from domain="*" headers="*" secure="false"/> 
</cross-domain-policy> 

This file means no restricition to anything, so this is good for trouble shooting but not suitable in production.

In addition, you should check your code to see whether you have already changed the url from localhost to your domain name in your flash file.

Sometimes, crossdomain issue is not related to crossdomain file.

For example: Have you chmod the directory on your server to 777 for file uploading.

You can refer to my answer in the following question: flex actionscript not uploading file to PHP page HELP!

You should give us some flash and php coding and also error message that you have received. Otherwise, your question is too general.

Community
  • 1
  • 1
michael
  • 1,160
  • 7
  • 19