<2003-9-26 下午01时11分02秒> <Error> <HTTP> <101019> <[ServletContext(id=3089809
,name=files,context-path=/files)] Servlet failed with IOException
java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '4810012'
bytes instead of stated: '4847909' bytes.
        at weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength
(ServletOutputStreamImpl.java:444)
        at weblogic.servlet.internal.ServletResponseImpl.ensureContentLength(Ser
vletResponseImpl.java:1179)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3109)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2588)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>

解决方案 »

  1.   

    response.setHeader("content-disposition", "attachment;filename="你的文件名") );      java.io.RandomAccessFile fout = new java.io.RandomAccessFile(fileName, "r");
          byte[] line = new byte[ (int) fout.length()];
          fout.read(line);
          java.io.OutputStream output=response.getOutputStream();
          output.write(line);
          fout.close();
          output.close() ;
     ------------------------------------------------------
               我们还年轻牛奶会有的奶牛也会有的 
                 可天天在 csdn 混这些会有吗 ??