W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

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

From: Kornel Lesiński <kornel@geekhood.net>
Date: Mon, 2 Aug 2010 17:53:24 +0100
Message-ID: <C90AAA8E-80DA-475D-BA3E-898268C79509@geekhood.net>
On 2 Aug 2010, at 17:21, Michael Kozakewich wrote:

>>> Dennis wrote:
>> Yes, but that wouldn't help since I want to force downloads regardless
>> of the browser settings. Maybe it would do if the type was set to
>> application/octet-stream, since those, by default, always get downloaded.
> 
> People don't often like it when they're forced to do something. If they want
> to download it, they can select "Save Link As..." from their browser. If
> they actually want to view it full-screen, they don't want to be forced to
> download it.
> 
> I see where you're coming from, but we try not to force users to do things.
> For the same reason, @target was removed from links.

I agree that it's not good to force users in general. However, this attribute can be implemented only as a hint for browsers to display Open/Save dialog. Users wouldn't be forced to download the file, it would just be easier for them to download.

OTOH users may be annoyed when their browser isn't saving some types of documents by default (and whether certain type of file should be viewed inline or saved might depend on context, e.g., I may want to read PDF booklets in the browser, but would prefer to save PDF receipts and tickets).

If Content-Disposition was attribute on <a>, then webmasters could easily offer right option (or both) where it makes sense.

Downloads can be "forced" already with Content-Disposition: attachment. It's just harder to do, and unfortunately that doesn't stop webmasters from trying. Popular PHP snippets for forcing download are among the most disgusting cargo-cult code I've ever seen ? they're collection of self-contradictory and nonsensical HTTP headers, break caching and resuming, and often have security vulnerabilities.

It would be great if we could obsolete those scripts.

-- 
regards, Kornel
Received on Monday, 2 August 2010 09:53:24 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:59 UTC