Closed swyxio closed 3 years ago
Allowing websites to request access to specific file paths is much more dangerous than only allowing websites access to file paths users explicitly picked, as such we're not currently planning to implement a feature like this.
i think he kind of want a cd or recursive mkdir method on the FileSystemDirectoryHandle itself
Say that you already have access to the root directory and you have saved it into IndexeDB and you know for sure that you will also have access to all the subfolder of something that you have already given permission to.
So it would be something like
const handle = await showDirectoryPicker()
handle.getDirectoryHandle('./some/deep/subpath/within/the/handle')
I guess it would not be anything harmful about that. It's possible to create like a recursive function of it...
we may ALREADY know the filepath and just want to read and write to it without opening a picker.
showXxxYyyPicker
functions to get user consent and the corresponding handle.If you're trying to do stuff across multiple browser restarts with some persistent file (for example loading and saving a user-created document, or seeking around in a custom database format), but it doesn't have to be literally exposed to other applications via the OS-local filesystem, why not just use the Origin Private Filesystem, which is (yet another) persistent local storage API that you can access without pestering the user?
hi folks thanks for working on this great API!
right now the only way to get a
FileSystemFileHandle
is by using ashowOpenFilePicker
. however we may ALREADY know the filepath and just want to read and write to it without opening a picker. as far as I can tell there's no way to do that.what i'd ideally want is something like:
use case: https://github.com/sw-yx/svelte-filesystem-demo