JavaScript rewrite by TypeScript.
upload.ts have error( near XMLHttpRequest.prototype.sendAsBinary ), but can create upload.js.