The problem with this is simple: let's say the developer created javascript code to go through your entire file system and fill it with dummy files, destroying your hard drive in the process? This is why javascript will not allow you to perform such an operation. When we want to store information, as a rule, execute it using code on the server side, and not on the client computer (unless, of course, we are not talking about things like cookies).
My answer is to let you rethink who makes the salvation and where. It should be up to the server in order to save and save any information for the user, and therefore you will not write such javascript code ... It is best to save data where your client cannot control or edit, for example, on the server for example.
I could suggest some simple PHP code, and instead of storing inside a text file, try a database ... PHP is a server language that allows you to save files to files on your server, however your server should be able to run PHP, most computers are not built into the PHP language, so you will also need a web server with built-in php.
Max Alexander Hanna
source share