Why does URLLoader.bytesTotal return a different value if the file is online or local?
I've got an xml file in my AIR app and I'm trying to determine his size. Here's what I did (seems complex so I don't know if it's the good way to do it) :
function checking_version_of_horairesXML():void{
var url_local:URLRequest = new URLRequest("horaires3.xml");
var url_online:URLRequest = new URLRequest("http://www.mywebsite.nc/horaires3.xml");
// Define the URLLoader.
var loader_local:URLLoader = new URLLoader();
loader_local.load(url_local);
var loader_online:URLLoader = new URLLoader();
loader_online.load(url_online);
// Listen for when the file has finished loadingl
oader_local_Complete loader_local.addEventListener(Event.COMPLETE, loader_local_Complete);
loader_online.addEventListener(Event.COMPLETE, loader_online_Complete);
function loader_local_Complete(e:Event):void {
trace("size of local file : " + (URLLoader(e.target).bytesTotal));
}
function loader_online_Complete(e:Event):void { t
race("size of online file : " + (URLLoader(e.target).bytesTotal));
}
It seems that the code for the local file is working as I'm getting in output :
size of local file: 703693
But I've uploaded the exact same file on my server and I have this in output :
size of online file : 60243
Why am I getting different results as these 2 files are identical ?
