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?

1

1 Answer 1

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}
   />
Sign up to request clarification or add additional context in comments.

2 Comments

This is for selecting the folder, but is there any option to select just the files from different directory.
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.