Created
June 7, 2011 19:58
-
-
Save beatgammit/1013020 to your computer and use it in GitHub Desktop.
Webkit: XHR push files
This file contains hidden or 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
function upload(url, uint8Data) { | |
var xhr, | |
formData = new FormData(), | |
blobBuilder = new WebKitBlobBuilder(), | |
blob; | |
blobBuilder.append(uint8Data); | |
blob = blobBuilder.getBlob(); | |
formData.append('aFile', blob); | |
xhr = new XMLHttpRequest(); | |
xhr.open('POST', url, true); | |
xhr.send(formData); | |
// xhr.send(blob); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment