0

I have been looking for a way to save the document edits a user has done to their system. For now I need to this without server side interaction. All of the solutions I have found on here Are 4+ years old e.g.,

Create a file in memory for user to download, not through server

Using HTML5/Javascript to generate and save a file

Is this still the best way or has an alternative been discovered that I am missing. Also, to make things worse I need something that works in IE

Community
  • 1
  • 1
Doc
  • 179
  • 2
  • 12

2 Answers2

0

If I were you I would use localStorage. localStorage is like cookies, but more powerful, easier to use, and more dynamic. localStorage is supported by IE 8 and higher.

There's a demo of it here: http://scripting.com/misc/localStorageDemo.html.

You could store the file as an object (because that's what it typically is parsed as in the browser).

If you'd like to know more about it, you can read here: http://www.w3schools.com/HTML/html5_webstorage.asp.

Elegant.Scripting
  • 757
  • 4
  • 10
  • 28
0

I have started to use Mozilla's localForage https://mozilla.github.io/localForage/ which will uses IndexDB (if available) and fallback to localStorage and WebSql. IndexDB provides greater storing capacity on the client-side than localStorage.

Doc
  • 179
  • 2
  • 12
  • The link in this answer is now broken, but localForage is still [available on GitHub](https://github.com/localForage/localForage). – Anderson Green Feb 17 '22 at 23:20