This is from and IIS page and I haven't tried in a servlet, but I expect the
HTTPSerlvetResponse has similar functionality

All thinigs seem to be need to be set correctly for it to work. Does this
work in Nutscape 6? I've had to do similar stuff 6 to get it to work.

Setting the buffer to false is a biggie as well as doing a binary write

' Send the HTML page back to the browser.
Response.Buffer = False
Response.CacheControl = "private"
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "attachment; filename=" &
strDlReportFileName
Response.BinaryWrite strHTMLResponse
Response.End

--

HTH

BTW: I know "ravi" is kinda popular name, but did you every work at
Spree.com?

Michael J. Geiser



"ravi" wrote in message
news:3f0d8ce2$1@newsgroups.bea.com...

Hello:

I am trying to setup downloading an excel file from a java
servlet. I have set the content type as follows.

response.setContentType("application/vnd.ms-excel");

Note that, this works fine using Netscape. But with IE
(6.0 / 5.5), it gives the following error:

Microsoft Excel cannot access the
file "https://servername.abc.com.......". There are
several possible reasons:......

Also, note that if I set the content type to text, then
the data is properly displayed in the browser.

Any help is highly appriciated.

Thanks