[Zope] Content-Disposition

Richard Wesley hawkfish@electricfish.com
Thu, 18 Apr 2002 15:33:06 -0700


At 12:01 AM +0200 4/19/02, Dieter Maurer wrote:
>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.

Yeah, I set it to 'text/x-my-type' and that seemed to slap it around enough.

>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.

Good point.

- rmgw

<http://www.electricfish.com/hawkfish/>

----------------------------------------------------------------------------
Richard Wesley           Electric Fish, Inc.       hawkfish@electricfish.com

"Grass will get you through times of no money better than
  money will get you through times of no grass."
                                       - Fat Freddy