[whatwg] "Content-Disposition" property for <a> tags
glenn at zewt.org
Sun Apr 10 11:49:03 PDT 2011
On Sun, Apr 10, 2011 at 1:59 PM, Bjartur Thorlacius <svartman95 at gmail.com>wrote:
> Right. As an end-user I ask: Does a web developer publishing links to
> resources have a say as to whether I render aforementioned resource
> immediately, write it to disk or both?
As far as Content-Disposition already allows us to do this, yes.
Note that this doesn't allow bypassing the "open/save" dialog you see in
most browsers. Content-Disposition: attachment asks the browser to show
that dialog, when otherwise it may have displayed the content directly,
without asking. (Browsers generally don't have a "show this file in the
browser, even though it's C-D: attachment" option on that dialog--they
should, but that's a separate issue.)
Better yet, File API could have an API for writing blobs to files.
FileWriter exists (don't think anyone's implemented it yet). It's an
important API, but covers a different set of use cases. <a download> allows
creating a download link to any URL (not just blobs) that behave like a
normal link, including things like the browser's standard context menu
items. FileWriter doesn't do this.
More information about the whatwg