Created
June 17, 2014 17:41
-
-
Save xem/cf8c21239c39f2c6ce27 to your computer and use it in GitHub Desktop.
multiple file drop
This file contains 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
<html ondrop="f(event);return!1"ondragover=return!1> | |
<script> | |
f=function(e){ | |
r=new FileReader; | |
d=e.dataTransfer.files; | |
for(i=0;i<d.length;i++){ | |
r.readAsArrayBuffer(d[i]); | |
} | |
r.onload=function(a){ | |
console.log(r.result); // wat? If I drop multiple files, there's only one ArrayBuffer there (on FF) and it doesn't work at all (on chrome) | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment