Skip to content

Instantly share code, notes, and snippets.

@cachius
Created November 15, 2016 16:13
Show Gist options
  • Save cachius/6888dc1e0e42159b098f0d857fe94d25 to your computer and use it in GitHub Desktop.
Save cachius/6888dc1e0e42159b098f0d857fe94d25 to your computer and use it in GitHub Desktop.
log = console.log;
self.onmessage = function(e) {
debugger;
var data = new FormData();
data.append('Filedata', e.data.file.slice(0, 127), encodeURI(e.data.file.name));
console.log(e.data.file.slice(0, 127));
var xhr = new XMLHttpRequest();
log('worker: xhr.open');
xhr.open('POST', location.href, false);
log('worker: xhr.send');
xhr.send(data);
log('worker: xhr.send.finished');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment