Write json to file locally via browser

4.2k Views Asked by At

I have a requirement which i need some input on, I am using a very outdated version of xojo for a legacy application, the requirement is i need to open a webpage on the users system which isn't connected to the internet!

So i have a folder containing a website on its entirety, when i open the index.html file it loads all the resources locally and does not require anything to be download or access the internet.

Now on this website the user performs some actions like a survey or a guide as an example and i need to record all these actions and store it on a file so that later when the user is connected to the internet i can upload the files to the server.

How can i write json data to a file on the users pc via IE/Chrome/Firefox/Safari using javascript? Any ideas will be helpful.

1

There are 1 best solutions below

3
On

You can only emulate a download, direct writing to local disk is not allowed.

See this post for possible answer:

Download JSON object as a file from browser