[Zope] RESPONSE.setHeader

Paul Zwarts paz@oratrix.com
Tue, 29 May 2001 13:17:25 +0200


Hi,

Does anyone know how to setHeader of the RESPONSE to a document in Zope
which would ordinarily be read as an html file will now be downloaded?

I list some files in a page and then I want to be able to download these
documents, but of course the browser will load and render them.

I have tried:
   <dtml-call "RESPONSE.setHeader('Content-Disposition','Attachment;
Filename=' + document)">

where document is the &dtml-absolute_url; of the object I want. But it will
give me a popup window to save the HTML file of the page that lists the
files I want available for download.

   <dtml-call "RESPONSE.setHeader('refresh', '4;URL=' + document)">

Will of course get me the correct page as well, but again, the browser will
render it since it is in fact of DTML Document type... But how do you force
a download?

Thanks again,
Paz