Thanks to all for very useful answers, but special thanks to David.
I found solution on the Cocoon mailing list [2].
In the main sitemap I defined action:
<map:actions>
<map:action name="set-header"
src="org.apache.cocoon.acting.HttpHeaderAction" />
</map:actions>
and a matcher for PDF files:
<map:match pattern="binaries/**/*.pdf">
<map:act type="set-header">
<map:parameter name="Content-Type"
value="application/x-download"/>
<map:parameter name="Content-Disposition" value="attachment
; \ filename={2}.pdf"/>
</map:act>
</map:match>
I tested this in FF and IE6 and it works fine.
Kind Regards
Petar
David Legg wrote:
Hi Petar,
This blog article may help clear up your confusion [1]. It actually
explains how IE handles mime types and when it does its own file
sniffing.
And this email thread on the Cocoon mailing list contains actual
sitemap suggestions you could use [2].
It all boils down to adding the Content-disposition header to the
response for the file.
Regards,
David Legg
Petar Becic wrote:
Hi all,
For known MIME types such as Microsoft Word ("application/ms-word"),
the default behavior is to open the document in the browser.
How can I configure hippo cocoon based website in order to prompt the
user to save the file directly to the user's disk, without opening it
in the browser.
Thanks in advance.
[1] http://blogs.msdn.com/ie/archive/2005/02/01/364581.aspx
[2] http://marc.info/?l=xml-cocoon-users&m=122338256805470&w=2
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
--
Met vriendelijke groet / Kind regards,
Petar Becic
Senior Software Developer
Levi9 Global Sourcing
===============================================================
Adress: Jan van Goyenkade 8, 1075 HP Amsterdam
Tel.: (+31) (0) 20 6701 947
Mobile: (+381) (0) 62 415 171
Email: [email protected]
SkypeID: p.becic
Internet: www.levi9.com
Chamber of commerce Levi9 Global Sourcing BV: 34221951
Chamber of commerce Levi9 Global Sourcing Benelux BV: 34224746
===============================================================
This e-mail may contain confidential or privileged information. If you are not
(one of) the intended recipient(s), please notify the sender immediately by
reply e-mail and delete this message and any attachments permanently without
retaining a copy. Any review, disclosure, copying, distribution or taking any
action in reliance on the contents of this e-mail by persons or entities other
than the intended recipient(s) is strictly prohibited and may be unlawful.
The services of Levi9 are exclusively subject to its general terms and
conditions. These general terms and conditions can be found on www.levi9.com
and a copy will be promptly submitted to you on your request and free of charge.
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html