Comment: Re:Chrome sucks anyways... (Score 1) 173
Yep, that's the one.
The main problem is that it's currently impossible to send binary data via XHR in Chrome without it getting eaten. What appears to happen is that everything gets "encoded" in UTF-8, which obviously is going to be a dog's breakfast. Even when using a BlobBuilder I just could *not* prevent things getting eaten when passing to xhr.send().
Firefox has a xhr.sendAsBinary() method that "just works". Nothing more needs to be said. Use xhr.sendAsBinary() instead of xhr.send() and all your problems are gone overnight. Oh, except for the fact that sendAsBinary() is non-standard and not supported in Chrome.
I ended up choosing the latter of two workarounds: using FileReader.readAsDataURL() (which encodes into base64) and unpacking the data: URL on the remote end, or using a FormData() object and using FormData.append() to place my File inside there.