Two important points. 1 - SWF must have ability to loading binary data from any domain. 2 - SWF cant load policy XML file from url, cause upload form allows me only to upload swf files, so I cant include any other data. I tried:
But it works only for SWF files. I tried to embed policy XML file:
var dataXML:XML =
<!-- http://www.foo.com/crossdomain.xml -->
<allow-access-from domain="*" />
But Security.loadPolicyFile(url:String) allows only to set file url, not data. So my question is, how can I allow SWF to load binary files from different domains without having any additional file? URLLoader code:
var request:URLRequest = new URLRequest("http://differentdomain.com/binaryfile.dat");
var words:URLLoader = new URLLoader();
words.dataFormat = URLLoaderDataFormat.BINARY;
This will make an security error, if file is from different domain than SWF file. Thanks for any help.
You probably need to use a Proxy server.
I want it script/server independent
To fetch from other domain, those domains must have crossdomain.xml permitting you to do so. I can’t walk down the hall going into people’s offices and grabbing files from their file drawers without permission.
However, a proxy server has different security rules and can get data from any server that doesn’t strictly block it.