And the swirl goes on ...
try putting putting
response.setHeader("Content-disposition", "attachment; filename=foo.csv");
and watch as you get two save as dialogs from the browser (I.E. 5.5, I think) ... ouch!

WARNING: You can waste a lot of time on this problem.  Proceed at your own risk :-)

We reported a bug to Microsoft on the double dialog problem ... you guessed it ... 
software is working as designed.  They actually said that having to respond to two 
"save as" dialogs was per design.

Figures,
John

-----Original Message-----
From: Mike Johnson [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 22, 2003 2:52 AM
To: Tomcat Users List
Cc: John Leveille
Subject: RE: Excel sheets



I was having the same problem with IE until I finally found a microsoft
document on the subject. It suggested setting the Content-disposition
header, which does force IE to treat files like you'd expect.

*shrugs*

eg:
response.setHeader("Content-disposition", "filename=foo.csv");


On Thu, 2003-02-20 at 18:31, John Leveille wrote:
> Ah, I have done battle with this one many times.  I grow weary of the fight.
> 
> First let me say that this problem can stem from a variety of causes given the many 
> combinations of browser make, browser version, and web server make and version.  In 
> the past I have found that I.E. ignores the content-type header (bad browser! bad 
> browser!).  But, by all means, do as Tim says and set the proper header (probably 
> text/csv).
> 
> If that doesn't do it, try adding a couple fake parameters to the URL (because I.E. 
> is looking there to decide what client app to launch).  For example, if you have a 
> servlet creating the CSV your URL might look like
> 
> http://localhost:8080/myservlet?a=b
> 
> change this to
> 
> http://localhost:8080/myservlet/foo.csv?a=b&saveas=/foo.csv
> 
> This is usually enough to convince the browser to do the right thing.
> 
> John
> 
> -----Original Message-----
> From: Tim Funk [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 20, 2003 9:10 PM
> To: Tomcat Users List
> Subject: Re: Excel sheets
> 
> 
> Tomcat is not sending the right header back( Content-type probably). 
> Telnet into port 80, simulate a web request and see what the server 
> repsonse header is and adjust tomcat accordingly.
> 
> -Tim
> 
> David Epstein wrote:
> > I have a website that serves up files, which are often .csv files. When
> > I run the site using IIS (ick), a user with Excel on their machine will
> > see the .csv files automatically open in Excel. But when I use the
> > Tomcat server, I can't get it to do the same. Is there an easy way to
> > enable this functionality?
> > 
> > Any help appreciated.
> > 
> > David Epstein
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Mike Johnson <[EMAIL PROTECTED]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to