Todavía luchando después de muchos intentos para leer la respuesta de un httprequest que es un flujo de datos binarios que representará una imagen jpg.httprequest y datos binarios en javascript
edición: todo el asunto
xmlhttp = false;
/*@[email protected]*/
/*@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;
}
}
@[email protected]*/
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);
estoy usando IE8, y no HTML 5 (también tratado en FF12) así que siempre terminan con errores con algo así como
xhr.overrideMimeType('text\/plain; charset=x-user-defined');
o
xhr.responseType = "arraybuffer";
incluso copiar en una obra postulante no variable de
var body = xhr.response; //.responseText , .responseBody
any ideas ¿qué hay de malo o qué puedo probar?
¿Por qué? ¿Qué está tratando de lograr? ¿Puede su servidor hacer una codificación b64? – mplungjan
no es un dispositivo incrustado y la compañía no cambiará su interfaz tristemente – Gobliins
Pero entonces, ¿cómo se supone que debes usar los datos binarios en el lado del script? – Raffaele