Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
log the binary content of files dropped in the browser. also works for multiple files.
<html ondrop="f(event);return!1"ondragover=return!1>
<script>
f=function(e){
d=e.dataTransfer.files;
for(i=0;i<d.length;i++){
with(new FileReader){
readAsArrayBuffer(d[i]);
onload=function(){console.log(new Uint8Array(result))};
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment