Hiya... not a day goes by where someone isn't trying to do this, but I'm trying to write edits to .json files from a local web page. I can read files fine, and parse the data. It's for a local music player. But I can't edit and save any of the meta-data, because of the security restrictions that stop webbrowsers writing to files. The .json files are synced over OneDrive.
Help me pick options to overcome this inability to save the data:
(1) Use a Chrome Extension? Discussion forums say that these won't actually solve the problem; data will still be stuck in local.storage.
(2) On the page, have a "SaveChanges" button that exports all the data into a .json file that the user can save via the "Download... Save As" type dialogue box. Until the user does so, changes are only kept in local.storage.
Advantage: Quite easy to program.
Disadvantage: Pretty clunky for the user, and, will lead to broken version control; as soon as edits are made on 2 different machines, one's .json file will just have to override the other's. Rubbish.
(3) Write a .bat file or powerShell file to extract SQLLite3 data from Chrome local.storage temp file? The data is quite readable in that file, so I could write a script that every 30 minutes (or so) takes data-edits out of local.storage and merges them into the .json files on OneDrive. This will be pretty smooth for the user.
(4) Just start again and don't use webtech..., write the damn thing in a compilable language like Java (ick) or something else.
(5) SOMEHOW get Chrome to save local.storage data in a way that I can sync just this one app's data on OneDrive. But how?
I think only (3) and (4) are feasible.
For a long time this music player (Moggy) has been based on MS Access, which was a fine and proven solution... but I'm trying to break away from VBA because *all the reasons*.
--
Vexen Crabtree