tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán F. Stefánsson <stef...@snote.decode.is>
Subject RE: setContentType / File download
Date Wed, 14 Mar 2001 15:09:19 GMT
oh goodie... someone else who has this problem!

I battled this one for a looooong time and finally, microsoft sent out
the following article on their web:
http://support.microsoft.com/support/kb/articles/Q279/6/67.ASP

And here is another article which I find interesting:
http://support.microsoft.com/support/kb/articles/Q267/9/91.ASP

My guess... M$ tried to fix the bug in the later one but screwed up
somewhere along the line which resulted in the first one.

Anyways.  This is due to one of the very few *acknowledged* (by
Microsoft I mean) bugs in IE 5.5.... so sorry, nothing you can do about
it!  but on the bright side... it's nothing you did wrong either ;o)
(this is what I'm trying to convince myself of after spending waaayyy to
much time on this).

Regards, Stefan.

p.s. If you're using tomcat I'd suggest you use this code instead of
what you have (just for readability):
response.setContentType("application/msexcel");
response.setHeader("Content-Disposition","attachment;filename=TUInventor
y.csv");

p.p.s.
I solved this by checking the "User-Agent" header in the request and if
it was IE5.5 I don't set the Content disposition header.  This pops up
the Save file/open dialog box but if you choose to save you'll get a
garbled name...  but at least you'll get the file!

-----Original Message-----
From: Gerd Trautner [mailto:gt@yuri.at]
Sent: 14. mars 2001 08:08
To: tomcat-user
Subject: setContentType / File download


Hi tomcat-user,

i have some troubles using the setContentType method.
I want to generate a CSV file of my database data and send it to the
browser. the browser should then say "save file as filenam.csv" ...

what i do is:

response.setContentType("application/msexcel;name=\"TUInventory.csv\"\nC
ontent-Disposition: attachment;filename=TUInventory.csv;");

this works for netscape browsers, but ie wants to save index.html.

any tips?

Gerd



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message