FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Generating "download" pages
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Generating "download" pages [message #186417 is a reply to message #186413] Sat, 19 July 2014 20:54 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 7/19/2014 4:06 PM, Christoph M. Becker wrote:
> 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 all ow too much quoted content.]
>

Christopher,

Don't worry, Pointed Head is just showing his ignorance again. You are
correct - you can't send two different URLs as a response to a single
request.

The easiest way to do it, IMHO, is to just put a javascript request in
the onload event (of the <body> tag). Have that perform the download.

Arno's idea is interesting, also. I admit I haven't tried it, but it
would be worth looking at when I get a few minutes, probably next week.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Resolved: Generating "download" pages
Next Topic: Your opinion on which technologies to use when building web applications
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 21 16:10:54 GMT 2024

Total time taken to generate the page: 0.04767 seconds