In a site I'm implementing, users save files on their local device. I want to implement autosave, but questions like this one convinced me it wasn't possible without a "File Save" dialog for every write to the file system (unless the user modifies their default browser settings).
However, I see that app.diagrams.net does it! Once I specify a file path via an initial dialog my edits are autosaved without additional dialogs. That project is open-source, but my efforts to find the relevant code have so far not succeeded.
Anybody know how it's done?
Here are the steps to demonstrate that it's possible:
- Browse to app.diagrams.net
- In the "Save diagrams to" dialog, choose "Device"
- "Create New Diagram"
- "Create"
- In the "Save as" dialog, enter a filename
- Make some edits
- Reload the page
- "Open Existing Diagram"
- In the "Open" dialog, choose your file - it opens with your autosaved edits.