tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Fyfe" <>
Subject RE: [BUG] Network connection reset while uploading large file
Date Wed, 19 Jul 2000 13:16:05 GMT
Thanks for the suggestion. But my original servlet already does that and still has the problem.
The sample code I included in my original message was created to try to narrow down the problem.
But I ended up narrowing it down to almost nothing and the problem still occurs.

Are you saying that you can upload a file larger than 40kb with no problems? Has anyone done
that successfully running tomcat locally or with IIS? Is there some configuration setting
that I am missing?


Steve Fyfe
CNI Corporation
Milford New Hampshire
(603) 673-6600

	-----Original Message-----
Sent:	Monday, July 17, 2000 10:13 PM
To:	<>
Subject:	Re: [BUG] Network connection reset while uploading large file

I think you may try opening the input stream of the request object, dump out everything till
the end, and then give out response.


Steve Fyfe wrote:

> I have discovered that when I attempt to upload a file larger than 40KB, Tomcat will
just reset the network connection. As a result, IE shows an error screen with the message
"Server or DNS not available", and Netscape gives an error message box saying "A network error
has occurred while sending data (Connection reset by peer)."
>  Whenever I send a file that is smaller than 40KB, the response produced by the test
servlet is correctly shown in the browser's window. But if I upload a file larger than 40KB
using the exact same configuration and servlet, the code in the servlet is executed but the
web page produced by the servlet never appears - the browser's error message appears instead.
> This problem occurs both when I run Tomcat locally (Win 98) and when I run it on NT 4
with IIS serving the static pages. I get the same problem using Tomcat 3.1 or 3.2b2 when running
locally. I have only tried 3.1 with IIS. I don't believe the problem is in IIS, since this
application works using a different servlet container on the same machine.
> I have put together a small test case that demonstrates the problem. As you can see from
the code below, the servlet is only a few lines long, and it does not even look at the uploaded
data. The only thing that is different with each test case is the size of the uploaded file
- larger than 40KB fails, but less than 40KB succeeds.
> Here is my test servlet - this is the entire code for the whole thing:
> // start servlet
> import*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> public class TestUploadServlet extends HttpServlet {
>   protected void doPost(HttpServletRequest req,
>                       HttpServletResponse res)
>                       throws ServletException, IOException {
>     ////res.sendRedirect("Error.htm");
>     PrintWriter out = res.getWriter();
>     out.println("<html><head></head><body>It worked!</body></html>");
>     out.flush();
>     res.flushBuffer();
>   }
> }
> // end servlet code
> If I substitute the "sendRedirect" line for all the lines below that, the same problem
> This is the web page that does the upload:
> <html>
> <head>
>   <title>Test Upload Form</title>
> </head>
> <body>
>    Test Upload Form<br>
>    <form name="upload" method="post" enctype="multipart/form-data"
>                  action="../Servlets/testupload">
>    <input type="file" name="UploadedFile" accept="*" size="50">
>    <input type="submit" name="SubmitBtn" value="Upload File Now">
> </form>
> </body>
> </html>
> Tomcat is still very new to me, so if there is any configuration setting I can change
that will resolve this problem, please let me know. I sure hope this can be fixed before 3.2
is final. In its current state I cannot use Tomcat since this web app must be able to accept
uploaded files larger than 100 MB (large page full color images or postscript).
> If I can supply anything else that will help to nail this one, please let me know.
> Steve Fyfe
> CNI Corporation
> Milford New Hampshire
> (603) 673-6600

View raw message