File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Problem with excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with excel" Watch "Problem with excel" New topic

Problem with excel

Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
I am trying to open an excel sheet from my JSP. I used the following code in my JSP to get it working.

response.setHeader("Content-disposition", "attachment;filename=ExcelBaselineMovedOut.xls");

When the browser is opening the excel, i am getting a message that reads

'C:\Documents and Settings\local files....\Temporary internet files\Content.IE5\7VCTHHP2\ExcelBaselineMovedOut.xls'cannot be found.
check the spelling of the file name and verify that the file location is correct.If you are trying to open the file from your list of most recently used files on the File menu,make sure that the file has not been renamed,moved or deleted

I tried deleting the temporary internet files. It works sometimes,but most of the times it doesn't work fine.

Would be great if someone can advice on this.


Karthik <br />SCJP 1.4 SCWCD 1.4 SCBCD 1.3
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

I'm guessing this is a pretty large file.

I've seen this happen with MSIE when there isn't enough room in your temporary internet files dir (TIF) to hold the file. Instead of telling you this, MSIE just skips the download and moves on to the section of code that tries to read the file. For us, telling the client to empty their TIF dir usually satisfies them.

Try increasing the max size setting for your TIF directory.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Thanks for the reply.
Even if i have 10 records,i am not able to open the excel.
I agree. Here's the link:
subject: Problem with excel
It's not a secret anymore!