[mod_python] sendfile problems with IE

Mark Norley m_norley_newsgroups at yahoo.co.uk
Tue Oct 31 09:45:12 EST 2006


Hope this list can save me again ;-)
This bit of code works fine in Firefox and Netscape but IE doesn't like it:

def handler(req):
    req.content_type = "application/vnd.ms-excel"
    req.headers_out["Content-Disposition"] = "attachment;
    return apache.OK

With IE the File Download dialogue looks strange. IE thinks the filename is
filehandler_py rather than taggedhits.xls:

Name: filehandler_py
Type: Microsoft Excel Worksheet, 13.5 KB
From: 'mysite'

filehandler.py is the name of the script for starters, not the file I want
to download, and why has IE swapped the dot for an underscore?

On pressing Save I get:
Internet Explorer cannot download filehandler.py from 'mysite'.
Internet Explorer was not able to open this internet site. The requested
site is either unavailable or cannot be found. Please try again later.

Does anyone know what I need to do for IE to recognise the file? I'm
thinking I'm missing a header field or something.  


Win XP SP2
Python 2.4.2
Apache 2.2.2
Mod_python 3.2.10
Netscape 7.2
IE 6

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.20/508 - Release Date: 31/10/06

Send instant messages to your online friends http://uk.messenger.yahoo.com 

More information about the Mod_python mailing list