tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57980] New: After submitting a multipart form-data, if the Http request object is not parsed and return from server without parsing, causes browser crashed ('program cannot display the webpage' message gets displayed from browser).
Date Mon, 01 Jun 2015 13:48:13 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=57980

            Bug ID: 57980
           Summary: After submitting a multipart form-data, if the Http
                    request object is not parsed and return from server
                    without parsing, causes browser crashed ('program
                    cannot display the webpage' message gets displayed
                    from browser).
           Product: Tomcat 7
           Version: 7.0.62
          Hardware: PC
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: pgarnaik.world@gmail.com

In a jsp, a form is created with enctype="multipart/form-data". we submit the
form
after uploading a file (say of size 10MB) to a servlet (jdk 1.7u80).

In servlet.doPost() followings code snippet is written to validate the max file
size that can be uploaded and if size exceed a fixed limit servlet redirects
control to a the same jsp page without parsing the multipart request.
------------------------------------------------
long contentLength = request.getContentLength();
long uploadFileSize = 1000000;

if(contentLength > uploadFileSize){
                  
getServletContext().getRequestDispatcher("/upload.jsp").forward(request,
response);
  return;
}
-------------------------------------------------
This code causes browser crashed and a message 'Program cannot display the
webpage' gets displayed by the browser to user.

This problem got resolved if we parse the request object before redirecting as
below.

org.apache.commons.fileupload.servlet.ServletFileUpload.parse(request);

However it causes performance issue.

Note: This problem is not there with Tomcat6 and jdk1.5 .

Additional Detail: Servlet 2.5 , JSP 2.1 and jdk1.7u80

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message