Hello! I'm Vadim - jee developer from russian IT company. We're using Tomcat 7.0.61 servlet container in production. I'm struggling with multipart configuring troubles. I've recently added multipart configuration to web.xml:

<multipart-config>
    <max-file-size>10485760</max-file-size>
    <max-request-size>10485760</max-request-size>
    <file-size-threshold>10485760</file-size-threshold>
</multipart-config>


Accordingly to https://docs.oracle.com/javaee/7/tutorial/servlets011.htm or https://docs.oracle.com/javaee/6/api/javax/servlet/annotation/MultipartConfig.html IllegalStateException should be thrown by web container if the size of any uploaded file is greater than MaxFileSize. I've discovered that some changes of yours was merged in parseParts method in org/apache/catalina/connector/Request.java. You added IllegalArgument etc in catch clause and saved it in " partsParseException" local variable.
Exceptions will be thrown in getParts method of Request.

But method getParts cant be called because request was rejected by server. I added org.apache.catalina.filters.FailedRequestFilter to my web.xml after that - I've got 400 in access log but it's not correctly forwarding to error-page.
I've added swallowAbortedUploads="false", but it doesn't help.

May be, you could you give me some advices to ways of handling FileSizeLimitExceededException exceptions.

Best regards, Vadim Zapisochnyy.


Reply via email to