I'm developing a web app using ReactJS and trying to create a txt file with a number in it on the local storage, c:\temp for example.
Is it possible to do it without keep asking the user for his approval (dialog)?
Thanks
I'm developing a web app using ReactJS and trying to create a txt file with a number in it on the local storage, c:\temp for example.
Is it possible to do it without keep asking the user for his approval (dialog)?
Thanks
localStorage is a browser API and not an arbitrary file on the user's disk. If you are going to use it, then there is a handy React hook for it.
You can't write to arbitrary files on the user's disk, although you can generate a download from in-memory data. This may be saved to the user's download folder or may prompt a SaveAs dialog (you can't control which).
If you want to store data on the server then you can make HTTP requests to it (i.e. use Ajax) and write a web service to process those requests.