Following error message appears in the log. INFO: cgi: runCGI (stderr):CGI.pm: Server closed socket during multipart read (client aborted?). The problem is that when creating the inputstream for cgi component there is only one single 'read' on the ServletInputStream, in reasonably large uploads this will not drain the buffer. I have a pathch ready and it looks like this: diff -u -r1.27 CGIServlet.java --- CGIServlet.java 14 Oct 2004 08:14:47 -0000 1.27 +++ CGIServlet.java 2 Nov 2004 15:42:25 -0000 @@ -1691,7 +1691,12 @@ ByteArrayOutputStream contentStream = null; if(!"".equals(sContentLength)) { byte[] content = new byte[Integer.parseInt(sContentLength)]; - int lenRead = stdin.read(content); + int lenRead = 0; + do { + int partRead = stdin.read( + content,lenRead,content.length-lenRead); + lenRead += partRead; + } while (lenRead > 0 && lenRead < content.length); contentStream = new ByteArrayOutputStream( Integer.parseInt(sContentLength)); if ("POST".equals(env.get("REQUEST_METHOD"))) { Hope someone can commit it to cvs repository. Maybe there should be an initial parameter for the servlet also that restricts maximum size of the upload? -- Antti
*** Bug 32028 has been marked as a duplicate of this bug. ***
Done for Tomcat 5.5.5.
And for 5.0.30.