By creating an input tag such as:
<input type="file">
The user isn't able to select directories. By enabling certain flags:
<input type="file" webkitdirectory mozdirectory msdirectory odirectory directory multiple>
The user can now pick any directory, but not single files.
Is there any way to enable both?
You can only enable one of the two.
<input type="file" id="myFiles" webkitdirectory mozdirectory msdirectory odirectory directory multiple>
The only way to select both files and directories using 'standard' ways is by providing two separate input
elements.
Anyway, when you select a directory the files are available through the DOM object
using document.getElementById('myFiles')
.
For now this is not possible.
There are several requests open for mozilla and chrome, you might want to keep up with them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With