Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IE7 XMLHttpRequest.send(binary)

301 views
Skip to first unread message

Martin Aliger

unread,
Sep 17, 2007, 8:00:15 AM9/17/07
to
Hello,

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).

Anthony Jones

unread,
Sep 18, 2007, 4:09:08 AM9/18/07
to
"Martin Aliger" <mal...@gmail.com> wrote in message
news:1190030415....@o80g2000hse.googlegroups.com...

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


Martin Aliger

unread,
Sep 20, 2007, 11:59:00 AM9/20/07
to
I'm sorry - its second send, of course. The one with argument. GET or
POST - same result: "invalid argument" error.

_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#)

Anthony Jones

unread,
Sep 21, 2007, 3:15:21 PM9/21/07
to
"Martin Aliger" <mal...@gmail.com> wrote in message
news:1190303940....@y42g2000hsy.googlegroups.com...

> I'm sorry - its second send, of course. The one with argument. GET or
> POST - same result: "invalid argument" error.
>
> _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");
>

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).

Martin Aliger

unread,
Sep 25, 2007, 5:21:41 AM9/25/07
to
Thanks Anthony!

I'll use our professional support for that. Bad luck Connect site for
IE is down atm (http://connect.microsoft.com/IE)

rajesh...@gmail.com

unread,
Aug 24, 2012, 4:37:25 PM8/24/12
to
This is really stupid bug....
I was having the same issue and please don't laugh at my fix;

xmlhttp2.open("POST", url + "?a="+sequence(), true);
xmlhttp2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp2.send(msg);

now when this 'msg' has value 0, it throw error;
Fix is put this 0 in a quote, like this '0' and it started working;

I guess using POST you cannot send null :-(

Regards,

Rajesh Kumar Mahato

http://www.letscopypaste.com
0 new messages