Hi, I have problem with sending multipart data via AJAX (XMLHttpRequest). Using similar code to this:
var data1 = new ActiveXObject("Scripting.FileSystemObject" ).OpenTextFile(fileName1, 1).ReadAll();
var boundary = "123098u19823j192j39123j1nini31n2" ;
var xhr = new XMLHttpRequest();
xhr.open("POST" , window.location.href, true );
xhr.setRequestHeader("Content-Type" , "multipart/form-data; boundary=" + boundary);
var request = "--" + boundary + "\r\n" ;
request += 'Content-Disposition: form-data; name="fileBox1"; filename="' + fileName1 + '"\r\n' ;
request += "Content-Type: application/octet-stream\r\n" ;
request += "Content-Length: " + data1.length+"\r\n\r\n" ;
request += data1 + "\r\n" ;
request += "--" + boundary + "\r\n" ;
request += 'Content-Disposition: form-data; name="textData"\r\n\r\n' ;
request += "value\r\n" ;
request+= "--" + boundary + "--" + "\r\n" ;
xhr.setRequestHeader("Content-Length" , request.length);
xhr.send(request);
data1 value seems OK. request.length is OK. request.charAt() works perfectly. But xhr.send(request) will send only first 200b (from about 50000 total). IE8 (and propably other versions) sends raw data only until some specified char in stream found (#0 propably). So to server arrive only first 200 (or so) bytes. Using IIS5.1, but from FF3 and SendAsBinary this code works perfectly, so I thing its only IE specific issue.
Is there some header or tag I'm missing?