Summary
At present, the showDirectoryPicker()
window API call is supported by Chrome, Edge, and Opera browsers.
async function getDir() {
const dirHandle = await window.showDirectoryPicker();
// run code for dirHandle
}
Is there any method to open folder by st.file_uploader
currently?
Links
By the way, the Live(Online) Demo of Logseq can be as an example. The user can open a folder and create a logseq vault inside.
Goyo
3
You cannot show a directory picker, but you can drag and drop a directory into the file uploader.
But it seems that there is no info for structure of the folder.
All the files choose by selector only has its filename.
Goyo
5
That is right, no info on where the bytes come from is passed to the application other than the bare file name.