- Home /
Loading images from cross-domain
Hi,
Unity docs at Security Sandbox of the Webplayer clearly state that downloading images from cross-domain servers is allowed but my "www = new WWW(imgURL); yield www; texture = www.texture;" code is erroring out with ERROR: Rejected because no crossdomain.xml policy file was found. Any idea how else can an image be downloaded? Please note that my imgURL is an https one to a script that outputs an image. Could that be an issue?
Thanks!
Exceptions
In order to find the right balance between protecting Web Player users and making life of content developers easy, we have implemented an exception to the security mechanism described above:
You are allowed to download images from servers that do not have a crossdomain.xml file. However, the only thing you are allowed to do with these images is use them as textures in your scene....
Answer by DaveA · Mar 14, 2012 at 11:50 PM
I was unaware of that exception, and never saw that it did what it said. I always use the crossdomain.xml file.
That said, a couple of options:
Try putting .jpg at the end of your url, ex: https://somedomain.com/somescript.cgi?mparam=whatever&ext=.jpg This may fool the WWW object into thinking you are directly accessing a texture file and allow it.
Make a proxy server yourself and pull stuff through it.
This works like a charm. Thanks Dave! ;)
Try putting .jpg at the end of your url, ex: https://somedomain.com/somescript.cgi?mparam=whatever&ext=.jpg This may fool the WWW object into thinking you are directly accessing a texture file and allow it.
Your answer
Follow this Question
Related Questions
Loading a higher resolution image into Unity than what is supported 0 Answers
How do you download image to UI.Image? 4 Answers
Load image through WWW taking too long 0 Answers
Detect WWW Image bitmap dimensions? 2 Answers
www not loading from image file 3 Answers