Reputation: 31800
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.
Upvotes: 0
Views: 2169
Reputation: 348972
To read a file, use the FileReader
API (examples):
To save the file, create an URL using URL.createObjectURL
(the blob is constructed via the FileReader
API, with type
application/octet-stream
), or using a data-URI (example).
Upvotes: 1