Hi All,

I have a servlet page that returns a file to a user. This works just fine in
IE 5, but I'm have a problem with a user who accesses the page from IE 4.72
through an MS Proxy 2.0 server.

They request the file and it's delievered back to them, but for some reason
the browser never realises taht the file is complete. After a while it just
times out with a strange "Could not copy file" error.

The Java bits are below -- any help appreciated.

Clayton


                        res.setHeader("Content-disposition","attachment;
filename=" + f_Name);

                        int pos;
                        String ext;
                        pos = f_Name.lastIndexOf(".");
                        ext = f_Name.substring(pos+1).toLowerCase();

                        if (ext.equals("doc"))
res.setContentType("application/msword");
                        else if (ext.equals("pdf"))
res.setContentType("application/pdf");
                        else res.setContentType("application/octet-stream");

                        res.setContentLength(fileSize);

                        obf.write(buf);
                        obf.flush();
                        obf.close();

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to