I am trying to do an ajax request
$.ajax({
type: "post",
url: "download.php",
error: function(data, status, err){
alert(JSON.stringify(data));
},
data: "fileid="+fileid
});
this request alerts "{"readyState":0,"responseText":"","status":0,"statusText":"error"}"
I have searched on google all i have come up with is a cross site ajax call(which this is obviously not)
I have tried putting the full url in and it does the same thing.
the only thing i can think of is the header and i don't know what would be wrong with it. Here is the request header from firebug
Host www.mydomain.com
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Content-Type application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With XMLHttpRequest
Referer http://www.mydomain.com/
Content-Length 8
Cookie PHPSESSID=27b7d3890b82345a4fc9604808acd928
I have added another request on a different page and it works just fine but this one keeps failing the header for the other request is:
Host www.mydomain.com
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept text/plain, */*; q=0.01
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Content-Type application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With XMLHttpRequest
Referer http://www.mydomain.com/differentpage.php
Content-Length 33
Cookie PHPSESSID=27b7d3890b82345a4fc9604808acd928