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

On 6/3/11 9:16 AM, Eduard Pascual wrote:
> Ok, I have never even thought about using the "filename" argument with
> an explicit "inline" disposition. When I am in control of the headers,
> I find it easier to "fix" the filename with 301/302 redirects

That doesn't work if the data is dynamically generated.

> In short, I think that responding with a 2xx code _and_ attempting to
> change what's essentially part of the URI through other means is a
> contradiction

The "filename to save the data as" is not "part of the URI".

Think a URI like this:

   http://mysite.org/generate_progress_report.php?quarter=Q12010

When saving, it would be good to use something like "Progress report of 
Q1 2010" as the filename.  But that's not "part of the URI" in any sense.

Note that some browsers will do weird parsing of the query params to 
attempt to extract a "useful filename".  That seems strictly worse than 
just using Content-Disposition.

> and thus a mistake on the best case, or some attempt to
> fool the browser into doing something it shouldn't do on the worst
> case.

I strongly disagree.  I think browsers that use the Content-Disposition 
filename for "attachment" but not "inline" are just buggy and should be 
fixed.

Of course it sounds like your position is that they should not use the 
filename for "attachment" either... (in which case you disagree not only 
with me, but with most of the web).

-Boris

Received on Friday, 3 June 2011 06:24:21 UTC