[whatwg] a rel=attachment

Ian Fette (イアンフェッティ) ifette at google.com
Thu Jul 14 12:00:16 PDT 2011


2011/7/14 Ian Fette (イアンフェッティ) <ifette at google.com>

> Many websites wish to offer a file for download, even though it could
> potentially be viewed inline (take images, PDFs, or word documents as an
> example). Traditionally the only way to achieve this is to set a
> content-disposition header. *However, sometimes it is not possible for the
> page author to have control over the response headers sent by the server.*(A related example is offline apps, which may wish to provide the user with
> a way to "download" a file stored locally using the filesystem API but again
> can't set any headers.) It would be nice to provide the page author with a
> client side mechanism to trigger a download.
>
> After mulling this over with some application developers who are trying to
> use this functionality, it seems like adding a "rel" attribute to the <a>
> tag would be a straightforward, minimally invasive way to address this use
> case. <a rel=attachment href=blah.pdf> would indicate that the browser
> should treat this link as if the response came with a content-disposition:
> attachment header, and offer to download/save the file for the user.
>
> -Ian
>

I should also point out that there was a similar proposal from Dennis
Joachimsthaler last year. There was a fair amount of discussion on the
thread back and forth; near the end Hixie's recommendation [1] was to
propose this as a rel= attribute and push forward with implementation. That
is essentially what we intend to do.

[1]
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/028148.html

-Ian



More information about the whatwg mailing list