Save file to specific directory #277
-
hi, is it possible to save files to a user-selected folder? I tried and failed using streamsaver.js. please advise how it should be handled |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sry, but that isn't possible with StreamSaver (or FileSaver.js for that mather) This is a browser settings and it can be adjusted by the user of where it should save the files (weather or not it should auto save or let the client pick a folder) |
Beta Was this translation helpful? Give feedback.
-
there is a new browser api available that will make this library a bit obsolete eventually when https://github.com/WICG/file-system-access becomes more accessible. With this new file system access you can use you can also use this new picker should have an option for hinting where it should save a file. |
Beta Was this translation helpful? Give feedback.
there is a new browser api available that will make this library a bit obsolete eventually when https://github.com/WICG/file-system-access becomes more accessible.
With this new file system access you can use
await window.showSaveFilePicker()
to ask the user where it should save the file and even what name or format the user wants to save it at.it's more like a "save as" rather than just plain "save"
you can also use
window.showDirectoryPicker()
to ask for a specific folder and ask for write permission to that folder...then you can write data to wherever you want without prompting the user further.
this new picker should have an option for hinting where it should save a file.
https://gi…