You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tammo van Lessen <cu...@taval.de> on 2002/07/26 16:41:25 UTC

Content-Disposition Header Field and Reader

Hello,

i've a question about sending response headers in a reader. I would like to
send a file to the browser with an other filename than the request url.

Ex: Request: 20020302.store will be saved as test.zip

I think, this could be done with the Content-Disposition header field, but I
dont know, where I have to set it in the reader!

Does anybody have an example for me?

Thanks
  Tammo


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Content-Disposition Header Field and Reader

Posted by Jeff Turner <je...@apache.org>.
On Fri, Jul 26, 2002 at 10:56:21PM -0400, Vadim Gritsenko wrote:
> > From: Tammo van Lessen [mailto:cusers-list@taval.de]
> > 
> > Hello,
> > 
> > i've a question about sending response headers in a reader. I would
> > like to send a file to the browser with an other filename than the
> > request url.
> > 
> > Ex: Request: 20020302.store will be saved as test.zip
> > 
> > I think, this could be done with the Content-Disposition header
> > field, but I dont know, where I have to set it in the reader!
> 
> From HttpHeaderAction.java:
> 
> * This action adds HTTP headers to the response.
> 
> Sound like what you need. Sitemap will be close to:
> 
> <map:act type="set-header">
>   <map:parameter name="Content-Disposition" value="test.zip"/>
> </map:act>

Or to be more RFC-compliant:

Content-Disposition: attachment ; filename=test.zip

I found this works beautifully in Mozilla, but not at all in IE5.5,
which seems to ignore the Content-Disposition altogether. 

--Jeff

> Vadim
> 
> 
> > 
> > Does anybody have an example for me?
> > 
> > Thanks
> >   Tammo
> > 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Content-Disposition Header Field and Reader

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Tammo van Lessen [mailto:cusers-list@taval.de]
> 
> Hello,
> 
> i've a question about sending response headers in a reader. I would
like to
> send a file to the browser with an other filename than the request
url.
> 
> Ex: Request: 20020302.store will be saved as test.zip
> 
> I think, this could be done with the Content-Disposition header field,
but I
> dont know, where I have to set it in the reader!

>From HttpHeaderAction.java:

* This action adds HTTP headers to the response.

Sound like what you need. Sitemap will be close to:

<map:act type="set-header">
  <map:parameter name="Content-Disposition" value="test.zip"/>
</map:act>


Vadim


> 
> Does anybody have an example for me?
> 
> Thanks
>   Tammo
> 


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>