mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -24,8 +24,9 @@ Example on getting a real path from a dragged-onto-the-app file:
|
||||
};
|
||||
holder.ondrop = (e) => {
|
||||
e.preventDefault();
|
||||
const file = e.dataTransfer.files[0];
|
||||
console.log('File you dragged here is', file.path);
|
||||
for (let f of e.dataTransfer.files) {
|
||||
console.log('File(s) you dragged here: ', f.path);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user