Is there a way to read the raw file content of the file and send the binary data to the server with an XMLHttpRequest ajax request? In HTML5 browsers I can do this:
reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function(e) {
xhr.send(e.target.result);
}
There are some libraries like FileAPI or FileReader polyfill but none of them support readAsArrayBuffer()
and if I use readAsBinaryString()
the binary data will be screwed up while converting to String, and extra characters will be added to the content.
Any suggestions?