When making a request to a remote server, Flash needs to first check the policy file cross-Domain to determine whether requests from your domain are allowed.
If you have access to the remote server, you can do the upload of a file with the name crossdomain.xml
to grant access to the application.
Detailed information on:
Example 1
Policy file to tell servers to allow access to Flash movies hosted on http://www.example.com
:
<?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="www.example.com" />
</cross-domain-policy>
Example 2
Policy file specifying servers that must allow access to Flash movies hosted on http://www.example.com
, written with or without www
:
<?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="www.example.com" />
<allow-access-from domain="example.com" />
</cross-domain-policy>
Example 3
Policy file that grants access to the Flash Player, regardless of the sub-domain that makes the request, by means of a wild card *
in the field of token of the sub-domain:
<?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="*.example.com" />
</cross-domain-policy>
Hello @dev. What is the problem specifically? Flash, PHP or Mysql? Is there an error? See here how to create a complete minimal and verifiable example.
– Omni