Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006077 [Resin] minor always 07-27-17 14:04 11-21-17 09:43
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.54 Product Version
  Product Build
Summary 0006077: multipart/form-data caucho.multipart.form.error
Description (rep by Steffen Busch)
Please fill "caucho.multipart.form.error" and "caucho.multipart.form.error.size" in case of IllegalStateException as well.


I'm trying to use the Servlet 3.0+ Capabilities of the multipart/form-data requests and looked up several Caucho resources such as:
 1: http://blog.caucho.com/2009/10/22/servlet-30-tutorial-uploading-files/ [^]
 2: http://www.caucho.com/resin-4.0/reference.xtp#multipart-form [^]


I would really like to use the two offered Request attributes as mentioned on the 2: Link to improve error messages to users.

<..>
If the upload is larger than the limit or if multipart-form processing is disabled, Resin will not parse the request and will set an error message in the "caucho.multipart.form.error" request attribute. The "caucho.multipart.form.error.size" will contain the attempted upload size.
<..>

However, the "caucho.multipart.form.error" and "caucho.multipart.form.error.size" request attributes are empty in the following two situations:


Sitation 1: IllegalStateException (caused by MultipartFormParser.java:137)

For example if a single File (Part) is processed and the Size is greater than <max-file-size>10M</max-file-size> from the Servlet's <multipart-config>

java.lang.IllegalStateException: multipart form data part 'File':'11148012' is greater then the accepted value of '10485760'
  at com.caucho.server.http.MultipartFormParser.parsePostData(MultipartFormParser.java:137)
  at com.caucho.server.http.AbstractCauchoRequest.parsePostQueryImpl(AbstractCauchoRequest.java:462)
  at com.caucho.server.http.AbstractCauchoRequest.parseQueryImpl(AbstractCauchoRequest.java:296)
  at com.caucho.server.http.AbstractCauchoRequest.getParts(AbstractCauchoRequest.java:247)



Sitation 2: IllegalStateException (caused by AbstractCauchoRequest.java:434)

For example if several files (Parts) are processed (none of them is bigger than <max-file-size> see Situation 1) but the total size is greater than <max-request-size>10M</max-request-size> from the Servlet's <multipart-config>

java.lang.IllegalStateException: multipart form data request's Content-Length '20780351' is greater then configured in @MultipartConfig.maxRequestSize value: '10485760'
  at com.caucho.server.http.AbstractCauchoRequest.parsePostQueryImpl(AbstractCauchoRequest.java:434)
  at com.caucho.server.http.AbstractCauchoRequest.parseQueryImpl(AbstractCauchoRequest.java:296)
  at com.caucho.server.http.AbstractCauchoRequest.getParts(AbstractCauchoRequest.java:247)

  
Note:
Stacktraces obtained from Caucho Resin 4.0.50


It would be great if you can fill "caucho.multipart.form.error" and "caucho.multipart.form.error.size" request attributes in both cases.

Note:
Whenever I experienced an IOException from MultipartFormParser caused by "throw formError" at least the "caucho.multipart.form.error" attribute was present and most of the time the "caucho.multipart.form.error.size" too.
For example:
 * multipart form data '{0}' too large
 * multipart form upload failed (possibly due to full disk)
 * multipart form upload failed because field '{0}' exceeds max length {1}
 * End of post before multipart-mime boundary

Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0006774)
ferg
08-02-17 14:25

server/1655
 

- Issue History
Date Modified Username Field Change
07-27-17 14:04 ferg New Issue
07-27-17 14:07 stbu Issue Monitored: stbu
08-02-17 14:25 ferg Note Added: 0006774
08-02-17 14:25 ferg Assigned To  => ferg
08-02-17 14:25 ferg Status new => assigned
08-02-17 14:25 ferg Resolution open => fixed
08-02-17 14:25 ferg Fixed in Version  => 4.0.55
08-03-17 14:43 ferg Status assigned => closed
11-21-17 09:43 ferg Fixed in Version 4.0.55 => 4.0.54


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker