Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binary data in the browser

Tags:

javascript

I'm using .overrideMimeType('text/plain; charset=x-user-defined'); on my XMLHttpRequest object to load a binary datafile into javascript. I'm able to get the data byte by byte with data.charCodeAt(pos) & 0xff;

This works great in FF and Chrome (The two browsers I've tested so far). I've not yet tested Safari - but I would guess that it will work. Everything I've read is that IE (including 9) and Opera do not support this.

For IE is there any alternative I can use? An ActiveX control possibly? Is there an alternative in Opera that I can use?

like image 759
Justin808 Avatar asked Sep 21 '26 19:09

Justin808


1 Answers

I had to use some VBScript to get it to work.

See how do I access XHR responseBody (for binary data) from Javascript in IE?

like image 141
Cheeso Avatar answered Sep 23 '26 09:09

Cheeso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!