Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
710 views
in Technique[技术] by (71.8m points)

html - How to make Select Directory using React?

I need to upload all files from a folder to server. I'm trying to implement Select Directory window, and not Select file.

The normal way like:

<input type="file" webkitdirectory directory/>

Did not work for me, and showed Select File window.

But when I created empty regular html file with this input tag, it was working fine. Does anybody know how to implement the solution using React?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

try bheptinh.

<input directory="" webkitdirectory="" type="file" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...