Hi all,

I'm having a problem with IE6.
My code is as follow:
-------------------------------------------------------------------------------

 BufferedInputStream bis =  new BufferedInputStream(new
FileInputStream("c:/bla.pdf"));
 ByteArrayOutputStream baos = new ByteArrayOutputStream();

response.setHeader("Expires", "0");
response.setHeader("Cache-Control", "must-revalidate");
response.setHeader("Content-Disposition",
"attachment;filename=\"bla.pdf\"");
 response.setHeader("Pragma", "public");
response.setContentType("application/pdf");

        int bytesRead;
        byte[] buff = new byte[4096];
        while ((bytesRead=bis.read(buff)) > 0) {
            baos.write(buff, 0, bytesRead);
        }
        bis.close();
        baos.close();
        response.setContentLength(baos.size());
  baos.writeTo(response.getOutputStream());
-------------------------------------------------------------------------------

THat will popup a dialog, where user can choose to open, save or cancel.
Saving is fine, but choosing to 'open' it in IE6 will open acrobat reader,
with error message 'file cannot be found'.

I've noticed that some guy encountered the same problem:
http://www.mail-archive.com/[email protected]/msg02126.html

and I tried to follow his suggestion without any luck. (somehow my http
response has cache-control: no-cache )


This only happen with stripes.
If I do the following in a plain servlet:

-------------------------------------------------------------------------------
 BufferedInputStream bis =  new BufferedInputStream(new
FileInputStream("c:/bla.pdf"));
        BufferedOutputStream bsos = new
BufferedOutputStream(response.getOutputStream());

        response.setHeader("Expires", "0");
        response.setHeader("Cache-Control", "must-revalidate");
        response.setHeader("Content-Disposition",
"attachment;filename=\"bla.pdf\"");
        response.setHeader("Pragma", "public");
        response.setContentType("application/pdf");

        int bytesRead;
        byte[] buff = new byte[4096];
        while ((bytesRead=bis.read(buff)) > 0) {
            bsos.write(buff, 0, bytesRead);
            bsos.flush();
        }
        bis.close();
        bsos.close();
-------------------------------------------------------------------------------

It works ok.


Has anyone ever had this problem before?


Thanks in advance for the help!




-- 
Best regards,


WiB
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to