flat-files https://zzarcon.github.io/flat-files
Get a flatten array of dropped files using FileSystem api
https://zzarcon.github.io/flat-files
import flatFiles from 'flat-files';
flatFiles(document.querySelector('#dropzone'), (files: FileSystemEntry[]) => {
files.forEach(file => {
console.log(
file.name,
file.fullPath,
file.getMetadata()
);
})
});
Imagine you have drag & drop support in your app, thats great. Now imagine the use drops a folder containing a folder containing a folder, containing a folder... you get the idea.
All that I want is to have a nice way to get all those files and do something with them (upload them, show a preview, etc). Thats what flat-files gives to you, it deals with the FileSystem and gives a flatten array of FileSystemEntry
- Release script
- Browser support
- Error callback