Still struggling after lots of tries to read the response of a httprequest that is a binary datastream which will represent an jpg image.
edit: the whole thing
xmlhttp = false;
/*@cc_on@*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end@*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp = false;
}
}
xmlhttp.open("GET", theUrl, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
var headers = xmlhttp.getAllResponseHeaders();
}
}
xmlhttp.send(null);
I am using IE8, and no HTML 5 (also tried in FF12) so i always end up with errors with something like
xhr.overrideMimeType('text\/plain; charset=x-user-defined');
or
xhr.responseType = "arraybuffer";
even copying into a variable won´t work
var body = xhr.response; //.responseText , .responseBody
any ideas whats wrong or wwhat i could try?