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

Re: [whatwg] Priority between <a download> and content-disposition

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 10 Aug 2013 00:15:06 -0700
Message-ID: <CA+c2ei9_ZLZvVUFq1fmRWSYaTS+2y3aKnZ0oVQCnejL2ZEW+qA@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: WHAT Working Group <whatwg@whatwg.org>
On Fri, Aug 9, 2013 at 7:47 PM, Ian Hickson <ian@hixie.ch> wrote:
>> >> 1) Content-Disposition: inline
>> [snip]
>> > This seems unambiguous. Where's the problem?
>> >
>> >> 2) Content-Disposition: inline; filename="B.txt"
>> [snip]
>> > Again, this seems unambiguous.
>> >
>> >> 3) Content-Disposition: attachment; filename="B.txt"
>> [snip]
>> > Again, seems clear.
>> I assume that you realize that there is a problem if you think the spec
>> is clear, yet people don't understand what the spec intends to say, or
>> that implementations do different things, that there still is a problem,
>> right?
> Yes, that's why I asked "where's the problem". :-)
> I don't understand why the spec is ambiguous. Can you elaborate?

Sorry, it's been too long. I no longer remember what was considered
ambiguous. Possibly the comments in the bugs linked to from this
thread has relevant information.

>> Note that in this case the problem wasn't with the filename, but rather
>> with "inline" vs. "attachment". At least if I recall correctly. It's
>> been a while.
> I'm not sure I know what problem you're referring to here.
>> > Well, this is a Mozilla site. Why is a filename set if you don't want
>> > it? Why would you want that video.ogg file downloaded as
>> > "with-target.txt"?
>> IIRC, the problem here was that the server was always sending
>> Content-disposition: inline, which made it impossible to use <a
>> download>.
> Content-disposition: inline doesn't make it impossible to use download=""
> according to the spec as far as I can see.

As I recall it. The problem was that markup like:

<a download href="foo.txt">

did not result in a download dialog if a request to foo.txt resulted
in a response that contained

Content-disposition: inline
Content-disposition: inline; filename="bar.txt"

I no longer remember if that was what required by spec, or if it was
just unclear to us what was required by spec. If the spec says that a
download dialog should be shown, then the most important problem is
solved/was only due to misunderstanding of the spec.

Ideally I would prefer the filename from the markup to override the
filename from the header, since people tend to get markup correct more
often than getting headers correct. At least in my experience. But I
could see that the consistency between same-origin and cross-origin
would be nice too, so I can live with using either name.

/ Jonas
Received on Saturday, 10 August 2013 07:16:01 UTC

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