cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Reijn <j.re...@hippo.nl>
Subject Re: Serialize to file?
Date Fri, 09 Feb 2007 15:34:30 GMT
Hi Gary,

i'll try to help you out.

Gary Larsen wrote:
> I can't say I get all the pipeline concepts yet so excuse be if I'm missing
> something simple.
> 
> Right now I only use the HTML serializer, but want to provide options in the
> app to use both the Text and HSSF serializers.
> 
> Is is possible to configure the sitemap or serializer to 'save to file' and
> prompt the user with a SaveAs dialog?


Well this is more or less a browser issue. Most browsers second-guess 
the server directives and do what they think is best. The browsers look 
at the file extension and try to guess the incoming content. I don't 
think there is a 100% reliable way of manipulating the browser to popup 
the 'save as' dialog. At OnJava I found an page recently with a solution 
[1].

You could try to set the content-type of the serializer to a type which 
is not recognized by the browser. For instance:

"application/x-download" or "application/x-unknown"

Next to that you can use an sitemap action or something equivalent to 
send an header to the browser:

("Content-Disposition", "attachment; filename=myfile.extension")


> 
> If not, is the standard approach to send output the the browser as normal
> and rely on the browser's menu options?

Yes you can do that.

> 
> Thanks,
> Gary  

Your welcome!

Regards,

Jeroen Reijn

[1] http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message