Another thing to check is what cache control headers you (or Struts) are sending, if any. Some versions of IE incorrectly delete the downloaded file before trying to open it in an external application if told not to cache it. The only work around I'm aware of is to not send cache control headers in this case.

L.

Szczepan Faber wrote:
I tested it on 4 different PCees with XP :-)

The problem might be that all those pcees have company-wide win-xp
distribution.

I implemented simple workaround but I don't like it: I removed 'attachment;'
from content-disposition and now IE opens the excel in web browser window
rather than in Excel (Firefox opens in excel, thoug), and I still can select
whether to save or open the document. Tomorrow we will decide if it pleases
customer.

Thanks a bunch,
Szczepan


2006/1/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]
:

I use a ContentType of "application/excel" and it seems to work OK.  You
might try that in your environment.

-----Original Message-----
From: Szczepan Faber [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 17, 2006 7:59 AM
To: user@struts.apache.org
Subject: gone MAD with servlet / xls download on winXP


Hi,

I made nice servlet (Struts action actually) that downloads
xls (or opens - depends what the users chooses).

headers:

response.setHeader("Content-Disposition", "attachment;
filename=report.xls");
response.setContentType("application/vnd.ms-excel");

works on win2k perfectly. I click a download link, then I can
choose whether to save or open - both work great.

Now win XP... Download works but when I choose to open the
file - it opens only if there is already ms-excel opened in
the background. If ms-excel is closed (typical scenario ;) ),
IE 6.0 seems to download the file (yes, the progress bar),
then opens the ms-excel, then I see beautiful error message
that the file "documents and settings/.../../report[1].xls"
cannot be found. In fact this file does not exists (IE's
progress bar is a malicious
lier) in any place of the hdd.

Note that everything works on IE 6.0 (or firefox) in win2k
(so I decided not to post any code samples) but opening file
fails on IE 6.0 in winXP

What is wrong then?

I tried plethora of different headers in every possible
combinations found in posts of similar (but not equal)
problems with file downloads. Please
help.......................................

Thanks in advance

---------------------------------------------------------------------
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]

Reply via email to