title: Multipart Config max file size not working in Tomcat 8
body: <p>I have a POST API which consumer <code>multipart/form-data</code> data.</p>
  
  <pre><code>@POST
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  public Response postEvent(@HeaderParam("id") String id, 
          @HeaderParam ("schema-version") String schemaVersion,
          byte[] serializedEvents)
  </code></pre>
  
  <p>I wanted to limit the maximum uploaded file size to 64 KB. </p>
  
  <p>So, I made the following change in <code>webapps\&lt;appName&gt;\WEB-INF\web.xml</code></p>
  
  <pre><code>&lt;multipart-config&gt;
    &lt;max-file-size&gt;65536&lt;/max-file-size&gt;
    &lt;max-request-size&gt;65536&lt;/max-request-size&gt;
    &lt;file-size-threshold&gt;0&lt;/file-size-threshold&gt;
  &lt;/multipart-config&gt;
  </code></pre>
  
  <p>But it does not seem to be working. I also tried changing the maxPostSize parameter of Connector, though, I know that will work only for case where I am consuming the body as <code>application/x-www-form-urlencoded</code>.</p>
  
  <p>I am using Tomcat 8.0 and Jersey as Rest implementation. Can anyone please suggest where am I going wrong here?</p>
  
  <p>Edit: Here is the screenshot of the request:</p>
  
  <p><a href="https://i.stack.imgur.com/dS21i.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dS21i.png" alt="enter image description here"></a></p>
  
  <p>And, here is the part of <code>web.xml</code>:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jersey-servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;multipart-config&gt;
          &lt;max-file-size&gt;65536&lt;/max-file-size&gt;
          &lt;max-request-size&gt;65536&lt;/max-request-size&gt;
          &lt;file-size-threshold&gt;0&lt;/file-size-threshold&gt;
      &lt;/multipart-config&gt;
  &lt;/servlet&gt;
  </code></pre>