I am trying to have a folder input instead of file input. I want to select a folder and not just a single file. I tried available solutions from already asked question, but non of them worked. This is what I tried
Tried
<input id="myInput" type="file" webkitdirectory directory multiple/>
Faced Problems
1). I am working on react and react highlights "webkitdirectory directory" and says "attribute directory no allowed here". Seems like react is rejecting these attributes. How to solve this?
https://bugs.chromium.org/p/chromium/issues/detail?id=59818
2). I have read that Linux doesn't support folder selection. I am working on linux and I cannot select a folder. Is the problem because of this? How can I solve it?
I think if 1st one gets solved then things will be fine. Please suggest a solution or work around for this.
Try this
<input type="file" directory="" webkitdirectory="" multiple />
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