Re: [request] "Download" Event for HTMLAnchorElement

* Bjoern Hoehrmann write:
> That something has been written to disk does not make destryoing data
> safe. It is not unsual, for instance, to expect that data can be saved
> more than once, and invalidating such expectations can lead to catas-
> trophic data loss. I think "release-after-first-save-action" is not a
> pattern to be encouraged, at least not without secondary safeguards.

There's no need to be so dramatic :-)

When a user decides to save a file that they have been working on in an
application, the file data is typically a temporary serialized version of
the file's state/model. Native applications will write the data directly to
disk using an output stream but that isn't possible for a web application
to do, so web applications need to generate the data in memory, as a blob,
before presenting it to the user for downloading. After the download has
been completed the data can be released from memory.

If Glenn is correct and the data can be released/revoked as soon as the
download begins, then that makes things a lot easier to deal with. No one
wants huge blobs of redundant data floating around in memory for no reason,
so manually revoking object URLs (which is something Mozilla
et al recommends) is important.

Received on Tuesday, 25 March 2014 19:15:05 UTC