Bruno Grampa wrote at 2006-6-26 12:46 +0200:
>i want to send an image or a pdf  to a browser not for viewing but for
>downloading.
>I've written this code:
><dtml-call "RESPONSE.setHeader('Content-type',
>'application/force-download')">
><dtml-call "RESPONSE.setHeader('Content-Disposition', 'attachment;
>filename=filename.gif')">

You add an additional '<dtml-var "index_html(REQUEST, RESPONSE)">'

It might be necessary to avoid white space around your tags.
Therefore, it is better to do this in a Python Script
rather than a DTML object.

There, it would look like:

       r = container.REQUEST; R = r.RESPONSE
       R.setHeader(...) # your additional headers
       ...
       return context.index_html(r, R)

-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to