javascript - What's the right approach to saving and loading files on client-only web apps? -


i'm developing application allow user create his/her own data, , since don't have backend or database, lives on user's session.

my ideal solution following:

  1. user works application, clicks on "save", gets download prompt, downloads file his/her filesystem
  2. user clicks on "load", file input dialog gets shown, user picks his/her file, , data again on app.

i thought in using filesystem api, work on sandboxed environment defeats ability user work data in browser.

i know can simulate download stringifying data dropping window make download. however, when want load data again using input type=file, don't have ability read actual contents of file, it's one-way path.

some other apps displays contents of file user , make user copy/paste content, simplify user.

finally, support @ least latest version of desktop browsers.

what option suitable situation?

you should offer files download, read them <input type="file"> using filereader.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -