Fix upload diffs on IE.

Review Request #6231 — Created Aug. 14, 2014 and submitted — Latest diff uploaded

Information

Review Board
release-2.0.x
7def6b3...

Reviewers

We were using File.readAsBinaryString() to get the contents of an
uploaded file. While Chrome and Firefox support this still, it's
actually a deprecated function that never made it out of beta, and IE
doesn't support it.

The proper solution, which is a bit more lengthy, is to read in as an
ArrayBuffer, create a Uint8Array view around it, and then convert the
contents to characters in the payload. This works on all browsers.

Tested uploading a diff on IE 10, 11, Firefox, and Chrome.

Unit tests pass.

Tested uploading valid Git diffs, empty files, and non-diff text files.

    Loading...