2

I have a schedule app built with AngularJS and I'm looking for a way to save the data changed within the app to disk after I close it. When I open the app again I want it to read the freshly modified JSON file again with the new data.

I don't need it to stay in localStorage because if I clear my cache I will lose all the changes.

Is it possible to save from localStorage to disk?

Any solution is welcome.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
Hard Coded
  • 70
  • 8
  • Do you mean having a user manually download a JSON file to save somewhere, so they can load it up again later? (The main question being, you're not trying to have this happen automatically, are you?) – Katana314 Mar 12 '15 at 13:08
  • I think I'd be happy doing it either way but of course it would be more efficient for that to happen automatically. – Hard Coded Mar 12 '15 at 14:28
  • 2
    If it's automatic, I'd say leave it as just localStorage. That *is* written to disk, and stays even on a full computer shutdown. Most browsers give it a separate listing from cookies when clearing things out, and I know I wouldn't want a browser letting a page make a temporary file that doesn't get removed on a "full clean". – Katana314 Mar 12 '15 at 15:08
  • 1
    Well, in that case, I'd really need an export feature to save the data from localStorage in order to use the app on another computer and then import it again. Any suggestion on how would I do that? – Hard Coded Mar 13 '15 at 08:23
  • 1
    I think there are some possibilities using Data URIs. Try following some of the suggestions in this question: http://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server – Katana314 Mar 13 '15 at 17:45

1 Answers1

2

It's not good solution. Work on FileSystem API is stopped and the API is not standartized. On the official wc3 site (the link above):

Work on this document has been discontinued and it should not be referenced or used as a basis for implementation.

But you can use it in Chrome

driver_by
  • 1,685
  • 15
  • 20