1

To save the JSON file into a local directory, I saw many ways here.

However, using pure JavaScript and HTML, I want to save the JSON file in an internal directory of the application, not a local directory. For example, if using a web hosting service, I create a directory and save the JSON file using script then, read it whenever I want.

Is it possible to do it?

CalgaryFlames
  • 678
  • 2
  • 10
  • 30

1 Answers1

1

What did you mean by "application directory"? In my view, this does not exist, in the sense that you are expecting.

As a web application, on the server side, you have the operating system with your file system, so here you could save your JSON in any directory using your backend language and provide it to your frontend in several ways .

Now, if what you want is to save your JSON on the client side (frontend), you don't have direct access to the file system (obviously, for security reasons). Then, you can use any of the storage systems provided by the browser: Local Storage, Session Storage, IndexedDB, Web SQL, Cookies, etc.

Silvair L. Soares
  • 1,018
  • 12
  • 28