Platform: Django 0.95, Win XP & 2003, Apache 2.2/mod_python 3.2.10

I'm running into an issue when returning data to Internet Explorer
that has a content type other than text/html.  More specifically, I'm
returning data in an html table format recognized by excel (content-
type: application/vnd.ms-excel), and IE chokes when the data is being
returned by Apache/mod_python (Firefox is ok).  Here's what happens
when the problem occurs:

1. I submit the request and IE opens a "Do you want to open or save
this file?" dialog.  This dialog indicates that it recognizes that an
excel file is being received, but it ignores the filename used in the
content-disposition field.

2. If I choose Open or Save, I get an error stating that it could not
dowload the file from its location.

When I make the same request from IE to the built-in WSGI server, it
works fine (the correct file name is chosen, and the file downloads or
opens correctly).  I've tested it on multiple Apache/mod_python
instances on win xp and win 2003, and IE6/IE7 on multiple computers,
all with the same result.

Though I don't think it's a code issue, here's what I use to return
the response:

response = HttpResponse(response_data, mimetype="application/vnd.ms-
excel")
response['Content-Disposition'] = 'attachment;
filename="SearchResults.xls"'
response['Content-Length'] = str(len(response_data))
response['Expires'] = "Mon, 26 Jul 1997 05:00:00 GMT"
return response

Any ideas?  I'm completely stuck.  The only thing I've noticed is that
the headers arrive in a different order when served under WSGI vs.
Apache/mod_python.  In the WSGI scenario, the content-type header
comes before content-disposition, and in Apache/mod_python it is the
other way around.  I forced the headers to be returned in the same
order under Apache/mod_python as they are returned by WSGI, but that
didn't fix the problem.

Thanks,

Sean


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to