Re: Generating "download" pages [message #186413 is a reply to message #186412] |
Sat, 19 July 2014 20:06 |
Christoph Michael Bec
Messages: 207 Registered: June 2013
Karma:
|
Senior Member |
|
|
Thomas 'PointedEars' Lahn wrote:
> Christoph M. Becker wrote:
>
>> and AFAIK there is no such thing as multipart responses for HTTP.
>
> There is; that is the purpose of the “Content-Disposition” header field.
>
> <http://tools.ietf.org/html/rfc6266>
Um, I am somewhat confused. RFC 6266 says (emphasis mine):
| The Content-Disposition response header field is used to convey
| additional information about *how to process the response payload*,
| and also can be used to attach additional metadata, such as the
| filename to use when *saving the response payload locally*.
This seems to be completely different then e.g. "Content-Type:
multipart/alternative" for emails.
> | Response Headers (source)
> |
> | HTTP/1.1 302 Found
> | Location:
> http://netcologne.dl.sourceforge.net/project/viplugin/viplugin/0.2.11/viPlu gin_0.2.11_E30.zip
>
> Note that the response body is displayed as empty.
This is not surprising, as the HTTP response status code is "302 Found",
which redirects to the URI given in the Location header field.
> I think the relevant fact here is that the target resource is served with
> “Content-Type: application/octet-stream”, because that is known to trigger a
> download dialog instead of navigation.
ACK. However, the content that could be saved, is the payload of the
very response that contained the Content-Type header field.
> <http://stackoverflow.com/questions/283752/refresh-http-header>
Thanks for the confirmation.
[Sorry, I had to snip more of the former discussion than I liked,
because my newsserver doesn't allow too much quoted content.]
--
Christoph M. Becker
|
|
|