Andreas Jung wrote:




--On 16. August 2006 17:28:00 -0500 Kirk Strauser <[EMAIL PROTECTED]> wrote:

I have a Python script that transmits a file to the user.  An excerpt:

    if not skipctypeheader:
        # Set the content type if one is defined for the file
        ctype = file.getProperty('content_type', d=None)
        if ctype:
            RESPONSE.setHeader('Content-Type', ctype)

    RESPONSE.setHeader('Content-Disposition', 'inline; filename=%s' %
filename)


I remember having had similar problems with IE and downloading files. In general we use only content-disposition: attachment for IE vs. content-disposition: inline for all other browsers. After that change we haven't had
any bug reports from IE users.

-aj

I had similar problems too.  This seems to work with IE:
        theFile=open( self.pdfpath,'rb')
        result = theFile.read()
        ....
        RESPONSE.setHeader('Content-Type','application/pdf')
        RESPONSE.setHeader("Content-Disposition","filename=report.pdf")
        RESPONSE.setHeader('Content-Length',len(result))
        RESPONSE.write(result)

David

_______________________________________________
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