[whatwg] a rel=attachment

Tab Atkins Jr. jackalmage at gmail.com
Thu Jul 14 14:44:15 PDT 2011


On Thu, Jul 14, 2011 at 1:53 PM, Glenn Maynard <glenn at zewt.org> wrote:
> That reminds me of something download=filename can't do: assign a filename
> while leaving it inline, so "save as" and other operations can have a
> specified filename.  That would require two separate properties.  One case
> I've come across is <img>, where I want to display an image, but provide a
> different filename for save-as.  Separating the filename would allow this to
> be applied generically both links and inline resources: <img
> src=f1d2d2f924e986ac86fdf7b36c94bcdf32beec15.jpg filename=picture.jpg>.

Optimizing for the user choosing to right-click=>Save seems like a
much more niche case than linking to a file that should be downloaded.

Plus, you could address it by just wrapping the <img> in an <a>:

<a href=uglyurl.jpg download=prettyurl.jpg><img src=uglyurl.jpg></a>

Alternately, there's nothing saying that @download can't be useful on
<img> directly.  It would still be embedded normally, but @download
would set the download filename the same way that it does on <a>.  (It
seems more obvious to me that the download filename is in @download
than @filename - the latter seems likely to confused people into
thinking that it's involved somehow in linking to the image, or that
you're required to set the filename on all images).

~TJ


More information about the whatwg mailing list