Re: [request] "Download" Event for HTMLAnchorElement

On 3/23/14 5:30 PM, "Si Robertson" <retromodular@gmail.com> wrote:


>Hi guys,
>
>This mailing list was suggested to me by one of the Chromium developers,
>so I apologize in advance if this mailing list is not appropriate for
>this request/proposal.
>
>In a nutshell, I am asking for a "download" event to be dispatched from
>anchor elements that support the "download" attribute.
>
><a href="blob:..." type="..." download="..."
>ondownload="release(this)">download</a>
>
>The problem that this new event would solve is this - when using a
>temporary object URL (blob) for the file data, e.g. programmatically
>generated content, there is currently no way of knowing when that file
>data has been written to disk, therefore there
> is no reliable way of knowing when it is safe to revoke the object URL
>in order to release resources.
>
>Thanks for your time.
>
>Regards,
>Si Robertson


Is the download generating a temporary copy of the blob to do the
download? If so, it seems it should be up to the browser to handle
cleaning it up, not the developer. If referring to the blob referenced by
the href, won't releasing it after the first download prevent it from
being downloaded again? Maybe an edge case, but not one I would want to
preclude. Also, if the browser doesn't know when the file's been
downloaded, how does it know when to fire the ondownload event?

Probably newby questions, but I'm working on some code that does exactly
this, programmatically generates anchors referencing programmatically
generated blobs, so I want to understand how they're handled and what
requirements are put on me to make sure things are cleaned up as
necessary. 

Thanks,
Brian

Received on Monday, 24 March 2014 18:52:25 UTC