I'm trying to upload a binary file to server via XMLHttpRequest
object. Good old technique for this is using ADODB.Stream activex but
other methods can be used too. I got working solution for IE6 (and IE7
with native XHR disabled) but IE7's XHR throws "invalid argument" all
the time.
Can someone validate this, please? Is it known issue? (any Connect
channel for IE7?)
Thanks in advance,
Martin
btw: I come with this failing example:
_xmlhttp = new XMLHttpRequest();
_xmlhttp.open("GET","serv2.aspx",false);
_xmlhttp.send();
var s = _xmlhttp.responseBody;
_xmlhttp.open("GET","serv3.aspx",false);
_xmlhttp.send(s);
(should be fine with some static pages as well).
It would have been better if identified which .send call is generating the
error. If the first the try using null as the parameter. If the second
that's understandable you're trying to send an entity body in a GET request.
Change the GET to POST and it should work.
--
Anthony Jones - MVP ASP/ASP.NET
_xmlhttp = new XMLHttpRequest();
_xmlhttp.open("GET","serv2.aspx",false);
_xmlhttp.send();
var s = _xmlhttp.responseBody;
_xmlhttp.open("POST","serv3.aspx",false);
_xmlhttp.send(s); //this is problematic line
alert("this never executes on IE7");
The error is from IEs object, not from server part - nothing is sent.
--
Martin Aliger (MCP on c#)
Yep that is definitely a bug. Using MSXML3 or 6 it works fine but the
browser provided XMLHttpRequest fails when s is an array of unsigned bytes
(the return type of responseBody).
I'll use our professional support for that. Bad luck Connect site for
IE is down atm (http://connect.microsoft.com/IE)