You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ra...@L-3com.com on 2007/10/09 17:10:00 UTC

Hit open twice on file download question...

 
Our webapp is required to download data files to the client.  To do this we
have written a servlet as follows:
 
ServletOuputStream sos = response.getOutputStream();
 
response.setContentType("application/octet-stream");
response.setContentLength(theBytes.length);   // the bytes is a byte array
read from a file...
 
response.setHeader("Content-Disposition","attachment;  filename=\"" +
filename + "\"");
 
sos.write(theBytes);
sos.close();
 
 
The above works fine in that the file is downloaded and the browser pops up
the window stating Open, Save, More Info..., or Cancel.  In Internet
Explorer when the user wants to Open the file the Open button needs to be
pressed two times.  All other buttons only need pressed one time and it
works.
 
Can anyone explain why this is happening or how I can make it stop?
 
Thank-you,
Ray Milburn
L3 Communications, GSI
 
-------------------
GO SPURS!!
-------------------