0

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?

  • Does this answer your question? [How to select multiple files with ?](https://stackoverflow.com/questions/1593225/how-to-select-multiple-files-with-input-type-file) – Jop Nov 07 '22 at 04:52

1 Answers1

1

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}
   />
Mohammed Shahed
  • 840
  • 2
  • 15
  • This is for selecting the folder, but is there any option to select just the files from different directory. – elango ram Nov 09 '22 at 05:02
  • 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 – Mohammed Shahed Nov 09 '22 at 05:31