W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 2001

hour glass continues

From: Sukumar Chakraborty <sukumarc@interrait.com>
Date: Mon, 15 Jan 2001 04:34:35 -0500 (EST)
To: <www-jigsaw@w3.org>
Message-ID: <NDBBLHPCKKGCHDGLHOLGAEEHCBAA.sukumarc@interrait.com>
Hi, I am facing a problem while downloading a file by a servlet using IE5.
After downloading is finished and the file is saved in my local disk, the
hour glass continues in my browser until I press the STOP button,
surprisingly the problem is not occuring when I am using Netscape. I am
enclosing the function below :

/***************************************************************************
**********************/
public class TestDownload extends HttpServlet {
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        response.setContentType( "application/doc" ); // MIME type for pdf
doc
		res.setContentLength();
        response.setHeader("Content-disposition",
                  "attachment; filename=" +
                  "table.doc");
       String fileURL = "test.doc";
       URL  url=new URL(fileURL);
       BufferedInputStream bis = new BufferedInputStream(url.openStream());
       BufferedOutputStream bos = new
ufferedOutputStream( response.getOutputStream());
       byte[] buff = new byte[2048];
       int bytesRead;
       while (-1!=(bytesRead=(bis.read(buff,0,buff.length)))){
           bos.write(buff,0,bytesRead);
       }
       if (bis!=null){
         bis.close();
       }
       if (bos!=null){
          bos.close();
      }
    }
}
/***************************************************************************
***********************/
Received on Monday, 15 January 2001 04:55:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:35 GMT