Created
December 22, 2009 13:43
-
-
Save meritt/261750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reader = new FileReader(); | |
reader.onload = function(e) { | |
var bin = e.target.result; | |
// bin is the binaryString | |
}; | |
reader.readAsBinaryString(file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", "upload.php"); | |
xhr.overrideMimeType('text/plain; charset=x-user-defined-binary'); | |
xhr.sendAsBinary(bin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment