How to open folder upload dialog when clicking dropzone? #1157
-
I made folder upload with webkitdirectory attribute in input tag, but I can't make the file open dialog as folder upload dialog. Here are screenshots of current dialog and wanted dialog. What's the solution for this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@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 Your only option, at the moment, is to disable the FS access API: |
Beta Was this translation helpful? Give feedback.
@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 thewebkitdirectory
on the input:<input {...getInputProps({we…