Skip to content

Instantly share code, notes, and snippets.

View kalys's full-sized avatar

Kalys Osmonov kalys

View GitHub Profile
@kalys
kalys / uploader.js
Created November 21, 2011 16:56 — forked from adis-io/uploader.js
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://image.torrent.kg/images/U8x5261.png', false);
xhr.responseType = 'arraybuffer';
xhr.send();
var blob = new WebKitBlobBuilder();
blob.append(xhr.response);
var file = blob.getBlob('image/png');
console.log(file)
var fd = new FormData();
fd.append("image[0]", file);