Cross Domain Issues

I am trying to get a picture from my website and I have placed the crossdomain.xml file in the root folder but can’t seem to get it to read. I have tried a few different ways but still fall short… Here is my code if it helps?

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class FetchImage : MonoBehaviour
List msgs = new List ();

IEnumerator Start ()
	var urls = new string[] {
    int port = 843;
	//Only needed in WebPlayer
	Security.PrefetchSocketPolicy("", port);
	Application.RegisterLogCallback (Logger);
	for (var i=0; i< 5; i++) {
		var requests = new List ();
		foreach (var url in urls) {
			var r = new HTTP.Request ("GET", url);
			r.Send ();
			requests.Add (r);
		while (true) {
			yield return null;
			var done = true;
			foreach (var r in requests) {
				done = done & r.isDone;
			if (done)
		foreach (var r in requests) 
			if (r.exception != null) {
				Debug.LogError (r.exception);                  
			} else {
				var tex = new Texture2D (512, 512);
				tex.LoadImage (r.response.Bytes);
				renderer.material.SetTexture ("_MainTex", tex);
				yield return new WaitForSeconds(1);
		yield return new WaitForSeconds(30);

void Logger (string condition, string msg, LogType type)
	msgs.Add (condition);

void OnGUI ()
	GUILayout.BeginVertical ();
	foreach (var i in msgs) 
		GUILayout.Label (i);
	GUILayout.EndVertical ();


I had this problem trying many different things I finally after looking at my apache log files realized that the file was not even being requested. After much searching I found that the cross domain xml policy is not a http request at all but rather a raw tcp request. So a web server cannot server the policy because it serves http not raw tcp. To fix this on my linux server i wrote a bash script that repeated loops the nc command to spit out my crossdomain file on port 843.

here is my policyserver script i run in the background as: > ./policyserver &

while true
cat crossdomain.xml | nc -l 843

then you can test that it works from a remote machine:

/> telnet 843

I also had to open my firewall 843 port.
Also I did:

/> xxd crossdomain.xml

to make sure that the first character was 3c ensuring that my crossdomain.xml file is properly encoded as ascii.

What I really do not understand is how some forums suggest putting the crossdomain.xml file in your root directory when, what is the point if it is not served over http?!?

try this it worked with me after 3 days of searching:

for example you want to call a php file select-user.php and you have the link

you simply remove

you will get the path php/select-user.php and every thing will work perfect

it will work for your picture too simply give the path direct to the pic without the domain name