I’m trying to write a simple client-side text editor using HTML5 and Javascript. Is it possible to overwrite the contents of an existing text file using HTML5? I know that the HTML File API makes it possible to read the contents of a file, but I haven’t yet found a way to modify or overwrite an existing file.
I’m trying to write a simple client-side text editor using HTML5 and Javascript. Is
Share
Prompt to open
To read a file, use the
FileReaderAPI (examples):Prompt to save
To save the file, create an URL using
URL.createObjectURL(the blob is constructed via theFileReaderAPI, withtypeapplication/octet-stream), or using a data-URI (example).