[whatwg] <a download> feedback
glenn at zewt.org
Sat Mar 3 13:30:14 PST 2012
Another use case: fixing Google's search results. They're currently
annoyingly broken: "save link as" on a result link in Firefox offers a
useless default filename of "url.htm". The "filename" attribute would fix
this: set the Content-Disposition filename without affecting the
disposition type attachment vs. inline). For example: <a
href="/url?data=..." filename="product manual.pdf">. That would simply set
a default "Content-Disposition: filename" field.
Setting Content-Disposition: attachment should be an attribute orthogonal
to the filename, eg. <a download>. The attachment vs. inline mode is an
orthogonal concept to the default filename, and the "download=filename"
design loses that orthogonality, which I believe is a serious flaw.
This is also an example of why having separate "view" vs. "download" links
is bad. Google search results shouldn't need separate "download" links to
be able to set the filename, leaving save-as on the main result links
broken. It should work properly with a single link.
More information about the whatwg