[whatwg] "Content-Disposition" property for <a> tags

Bjartur Thorlacius svartman95 at gmail.com
Sun Apr 10 10:59:59 PDT 2011


On 4/10/11, Glenn Maynard <glenn at zewt.org> wrote:
>> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-July/027455.html
>
> A big +1 to the proposal in this thread, to allow specifying
> Content-Disposition behavior in anchors.  <a download=filename.txt> would
> have the effect of adding (or overriding) the header "Content-Disposition:
> attachment; filename=filename.txt".
>
> It would mean I'd no longer need to use server-side hacks to cause
> Content-Disposition to be sent for download links, eg. where "?download=1"
> adds the C-D header.
>
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?

> I also just now had to implement a server-side script that receives base64
> file data and a filename in parameters, and responds by echoing it back.
> That's an ugly hack to allow client-side data to be saved to disk, and
> doesn't work with serverless web apps.  This would be fixed, allowing both
> data: URLs and File API object URLs as download links.
>
Better yet, File API could have an API for writing blobs to files.


More information about the whatwg mailing list