dimanche 30 novembre 2014

Save HTML locally with Javascript


I do know that Javascript cannot write data in the filesystem, for security reasons. I have often read that the only way to save data locally with Javascript is cookies or localStorage.


But is it possible, in the very specific case when the file is accessed locally (and not through internet) to write data locally ? (without any server language, and even without any server at all... just local browsing of a HTML file)


For example, would it be possible, by clicking on SAVE here on this page ...


...that the HTML file is overwritten with its new content ? (i.e. the local HTML file should be updated when SAVE is pressed).




enter image description here




Is this possible to SAVE a file thanks to Javascript, when the HTML page is accessed locally?


Note: I want to be able to silently save, not propose a Download/Save dialog box in which the user has to choose where to download, then "Are you sure to want to overwrite" etc.





Aucun commentaire:

Enregistrer un commentaire