I wish to create a client-side only app in Angular2 where the user is prompted to select a folder on his hard-disk as a workspace, meaning that files will be written by the app inside that folder. I want to know how that can be achieved or if it is even possible. Thank you in advance.
No.
JavaScript, running in a web browser, outside of a browser extension, cannot write to the user's file system.
It can only read from files explicitly selected using a file input.
The closest you'll come to an exception is for internal browser storage areas such as localStorage.
TL;DR no.
But you can use File and Directory Entries API which works only in Chrome and Firefox and is non standard.
And I do not recomend it to use this, same as the documentation says:
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With