I want to select multiple files from different directories by using html input type="file" element. I couldn't find any resource to do this. is there any npm package available that can be used either in react js or vue js?
1 Answer
on input element add multiple attribute
<input
type="file"
name="upload-files"
multiple
/>
If on chrome. firefox and and to upload folder.
<input
type="file"
name="upload-files"
multiple
directory={isDirectorySelectable ? "directory" : null}
webkitdirectory={isDirectorySelectable ? "webkitdirectory" : null}
/>
2 Comments
elango ram
This is for selecting the folder, but is there any option to select just the files from different directory.
Shahed
You can only select files / folders from the current open file dialog. So you couldn't multiple files from multiple directory because you can only select file/ folder at a time