0

I have an HTML5 app that will be a loading content (photos) from other sever. Before it was a flash app so simply crossdomain.xml would take care of that. Now, can I use the same crossdomain.xml file in the root?

here's the XML

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="localhost" secure="false" />
<allow-access-from domain="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

I'm trying and still getting error loading. Is there maybe any special method to implement that? I have access to both servers, the one with the HTML app and the other with the photos.

Steve Harrig
  • 175
  • 1
  • 3
  • 9

1 Answers1

1

The crossdomain.xml file only works within Flash applications as you stated. You probably want to take a look into cross-origin resource sharing (or CORS) which adds some simple HTTP headers that can whitelist cross domain requests.

On the server you're requesting to, you'll probably want to add a HTTP header like:

Access-Control-Allow-Origin: http://www.example.com

replacing example.com with the domain you're requesting from. You can read more over on Wikipedia.

Steven V
  • 16,357
  • 3
  • 63
  • 76