From 0e24d148fdbe527cbd6c5b315adbeaf21c6112ec Mon Sep 17 00:00:00 2001 From: Matt Slay Date: Tue, 19 Jul 2016 23:51:58 -0500 Subject: [PATCH] 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. --- docs/api/file-object.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api/file-object.md b/docs/api/file-object.md index d0f36e273dfa..b1e643c74080 100644 --- a/docs/api/file-object.md +++ b/docs/api/file-object.md @@ -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; };