You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Szczepan Faber <sz...@gmail.com> on 2006/01/17 13:58:53 UTC

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

Re: gone MAD with servlet / xls download on winXP

Posted by Ed Griebel <ed...@gmail.com>.
I agree, it sounds like a configuration issue on your PC. Have you
tried it on a different PC? Possibly one not set up by the same
Corporate IT department?

-ed

On 1/17/06, Thomas Joseph <th...@kottsoftware.com> wrote:
> Try any/all of these:
> 1. WinXP + Firefox.
> 2. reinstalling Excel
> 3. save file and open
>
>
> >
> > 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.
>
> Regards
> Thomas Joseph
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
    "The greatest tyrannies are always perpetrated in the name of the
noblest causes." Thomas Paine
    "Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety" - Benjamin
Franklin

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


Re: gone MAD with servlet / xls download on winXP

Posted by Thomas Joseph <th...@kottsoftware.com>.
Try any/all of these:
1. WinXP + Firefox.
2. reinstalling Excel
3. save file and open


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

Regards
Thomas Joseph


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


Re: gone MAD with servlet / xls download on winXP

Posted by Rick Reumann <st...@reumann.net>.
Szczepan Faber wrote the following on 1/17/2006 7:58 AM:

> 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");

Just for kicks, instead of doing it from an Action (or pure Servlet), 
forward to a JSP and set the response stuff up top:
<%
response.setContentType("application/vnd.ms-excel");
response.setHeader("Pragma", "");
response.setHeader("Cache-Control", "max-age=0");
%>

Also, make sure you have not external links to style sheets or images.

-- 
Rick

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