Skip to content

How to open folder upload dialog when clicking dropzone? #1157

Answered by rolandjitsu
azvast asked this question in Q&A
Discussion options

You must be logged in to vote

@azvast those 2 URLs don't lead to any relevant info.

As for webkitdirectory, that's a non-standard attribute. But, it should be working when the File System Access API is not used.

If you're using the latest version of this lib and a modern browser, it will most likely use the FS access API to open the file picker on click. And since we use showOpenFilePicker, you cannot pick directories. Unfortunately, at the moment, we don't handle using showDirectoryPicker when a user sets webkitdirectory, but I imagine we could.

Your only option, at the moment, is to disable the FS access API: useDropzone({useFsAccessApi: false}). And use the webkitdirectory on the input: <input {...getInputProps({we…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@demarchenac
Comment options

Answer selected by azvast
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants