Update file-object.md

Added a for loop to iterate over the array of files, which allows processing of multiple files being dropped over the "holder" div.
This commit is contained in:
Matt Slay 2016-07-19 23:51:58 -05:00 committed by GitHub
parent 4081381700
commit 0e24d148fd

View file

@ -24,8 +24,9 @@ Example on getting a real path from a dragged-onto-the-app file:
}; };
holder.ondrop = (e) => { holder.ondrop = (e) => {
e.preventDefault(); e.preventDefault();
const file = e.dataTransfer.files[0]; for (let f of e.dataTransfer.files) {
console.log('File you dragged here is', file.path); console.log('File(s) you dragged here: ', f.path);
}
return false; return false;
}; };
</script> </script>