1

is it possible to select files or folders with single input tag

Note--->i am able to select mutiple files but problem is for selecting a folder and file we need two buttons. i want to do it by single input field.

<input id="input-file" webkitDirectory="" type="file" multiple/>
Vikash Mishra
  • 319
  • 3
  • 11
  • 1
    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) – Heartbit Jan 14 '22 at 11:37
  • No, i want that user can either select files or folders. – Vikash Mishra Jan 14 '22 at 11:39
  • this answer may help you... https://stackoverflow.com/a/2809706/9085612 – alexleo2000 Jan 14 '22 at 11:54
  • 1
    after including webkitDirectory only folder can be selected and in this case we can not select file. – Vikash Mishra Jan 14 '22 at 12:00
  • 2
    I think you can not do it with pure HTML. take a look at [this](https://www.examplefiles.net/cs/522988). also, you can use some plugins like dropzone that may help. look at [this](https://www.meziantou.net/upload-files-and-directories-using-an-input-drag-and-drop-or-copy-and-paste-with.htm) – sajjad rezaei Jan 14 '22 at 12:21

0 Answers0