On the thread today called "gone MAD with servlet / xls download on
winXP", someone suggested that sending the no-cache directive will
cause IE to download the file and then remove it before starting the
associated application. This sounds like what is happening in your
case as well.
-ed
On 1/17/06, temp temp <[EMAIL PROTECTED]> wrote:
> I am using struts action class to download a file .
>
>
> Here is the action class
>
>
> public ActionForward execute(ActionMapping aActionMapping, ActionForm
> aActionForm,
> HttpServletRequest aHttpServletRequest, HttpServletResponse
> aHttpServletResponse)
> throws Exception {
> String aFileName=aHttpServletRequest.getParameter(IWeb.FILE_NAME);
> aHttpServletResponse.setContentType("application/octet-stream");
>
> Integer aSysAttachId = new
> Integer(aHttpServletRequest.getParameter(IWeb.SYS_ATTACH_ID));
> aHttpServletResponse.setHeader("Content-Disposition",
> "attachment; filename=\"" +aFileName+ "\"");
>
> download(aApplicationInfoDelegate.getApplicationAttachemntFile(aSysAttachId),aHttpServletResponse);
> return null;
> }
>
> private void download(byte[] byteArray, HttpServletResponse
> httpServletResponse)
> throws IOException, SQLException {
> try {
> BufferedOutputStream aBufferedOutputStream =new
> BufferedOutputStream(httpServletResponse.getOutputStream());
> aBufferedOutputStream.write(byteArray,0,byteArray.length);
> aBufferedOutputStream.close();
> } catch (Exception e) {
> throw new IllegalArgumentException(e.getMessage());
> }
> }
>
>
>
> download works in mozilla but in internet explorer when user chooses to
> open the downloaded file (a pdf) rather than saving IE opens Adobe Acrobat
> reader
> with an error message "There was an error opening this document .This file
> cannot be found."
>
> Can somebody guide me what is going wrong here ?
> Thanks & Regards
>
>
>
>
> ---------------------------------
> Yahoo! Photos – Showcase holiday pictures in hardcover
> Photo Books. You design it and we'll bind it!
>
--
"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