- Home /
crossdomain.xml policy file
Hi,
Just rolled onto the latest beta of unity3, I imagine this question will be raised at some point. I did not find help pertaining to this file.
1) What should the content be for general dev, not release (give us a non blocking example, we will figure out the release at some point).
2) I tried to use a sample one with the following information :
<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
I have put it in the root of my asset folder and in the root of my web site (where I get my bundles and web pages) but it does not work.
Thanks for your help in advance !
Just found it, look into the documentation for Security Sandbox on the webplayer 3.0, its right there !
When you solve your own problem, put it in an answer, and checkmark it so everyone else knows.
Answer by Funky Swadling · Mar 02, 2011 at 05:56 PM
After much bashing my head into walls, it appears that the above text works ONLY IF SAVED AS A UTF-8 FORMATTED .XML FILE.
If you save it as a different character set, such as the one my (stupid) editor defaults to, it will not work.
I think that's likely why it works for some people, not for others, and no one can quite figure out why.
If this is true, then it must be a bug because Unity should recognize it even if it isn't UTF-8 encoded. Have you reported a bug?
I think I may have just experienced the same thing. $$anonymous$$y crossdomain.xml was not working, so I logged in to the server, opened the file with vi, saved it, then it started to work. Thanks!
The above text is 7-bit ASCII, so 99% of encodings will be identical. So unless your text editor defaults to something like EBCDIC or a $$anonymous$$icrosoft Word document, it will not matter. Conceivably Unity could have a bug with line-endings, but that's not specified by encodings like UTF8.
Notepad (among other text editors) by default saves UTF-8 encoded text by inserting the "Byte Order $$anonymous$$ark" (U+FEFF) before the beginning of the text. It is encoded as the byte sequence 0xEF 0xBB 0xBF. It is meant to be used with UTF-16 (and possibly UTF-32), which can be little-endian or big-endian encoded, but has no function in UTF-8. Notepad does this to identify UTF-8 documents, because that particular sequence of bytes at that particular position is unlikely to appear in most other encodings.
However, many X$$anonymous$$L parsers expect the first byte to be 0x3C (U+003C, "Less-than sign" in UTF-8), and they fail to parse the document if that is not the case. Possible solutions are to save the document as "ANSI" (in Notepad, as long as you don't use characters above 0x7F), "ASCII" (where available), or use a different text editor (especially if you need Unicode characters).
Answer by josesenra · Nov 11, 2010 at 01:04 AM
Hi all... I simply put a crossdomain.xml file in my site's root with the excat same code from the example and it worked fine..
Thanks all ;)
is the crossdomain.xml file we are supposed to use a generic one? or do we have to specify it?
I know it sounds like a obvious question, but I'm having trouble