[Zope] Content-Disposition

Dieter Maurer dieter@handshake.de
Fri, 19 Apr 2002 00:01:43 +0200


Richard Wesley writes:
 > I am not having any luck trying to download some script-generated 
 > text from a browser (IE5/Mac in this case).  When I try the following 
 > in a python method:
 > 
 > request.RESPONSE.setHeader('Content-Disposition', 'attachment; 
 > filename=file.txt')
 > print 'Hello, filesystem!'
 > return printed

It might help to use

   RESPONSE.setHeader('Content-Type','application')

in addition.

Some browsers are known to ignore this header and stubbornly look
at the filename. In this case, you might need to drop the ".txt"
extension.


Dieter