Hi Casey,

Did you get the code I sent you?

I already have a solution from Gregor Heine similar to the one described
below. It is in the "download" method in Document.py. It works too.

Regards,
Simon.

> -----Original Message-----
> From: Casey Duncan [mailto:[EMAIL PROTECTED]]
> Sent: 12 June 2001 16:16
> To: Blandford, Simon [BSS Audio UK]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Zope-dev] How to return downloadable content from Python
> Method
> 
> 
> > "Blandford, Simon [BSS Audio UK]" wrote:
> > 
> > I am compressing files which need to be uncompressed inline before
> > download. The DTML <href=...> calles a python method in the product
> > which returns the uncompressed file data. Say this file is an MSWord
> > document, how do I return this as a file to download? Presently, the
> > browser just tries to display the binary file and makes a 
> mess of it.
> > 
> > Regards,
> > Simon B.
> 
> It probably is not setting the content-type header. Add something like
> this to the method that returns the data:
> 
> RESPONSE.setHeader('Content-Type', self.content_type)
> 
> Where content_type is set to the MIME type of the data, which 
> for MSWord
> is 'application/msword'
> -- 
> | Casey Duncan
> | Kaivo, Inc.
> | [EMAIL PROTECTED]
> `------------------>
> 

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to