When dropping files and accessing to the info of those files, with
let files= e.dataTransfer.files;
you could check the file size (https://developer.mozilla.org/en-US/docs/Web/API/File). But if you use the newer (and the substitute as far as I can read)
let items = e.dataTransfer.items;
Then there is no way to access to the file size (https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items).
Which would be the correct way to know the size of the dropped file?
Answer: by accessing to the file with .getAsFile()
BUT, how to do that when reading a directory? See the code
let items = e.dataTransfer.items;
for (let i=0; i < items.length; i++) {
let item = items[i].webkitGetAsEntry();
if (item && item.isFile)
console.log(items[i].getAsFile()); // HERE IT WORKS
else if (item && item.isDirectory) {
item.createReader().readEntries(function(entries) {
for (let j=0; j<entries.length; j++)
see_file(entries[j].getAsFile()); // HERE IT DOES NOT WORK
});
}
}