title: Spring Boot with Jersey Multipart File upload not working
body: <p>I am using Spring Boot Jersey in my application and Trying to upload Multipart File using REST , but whenever I making API call , it always give below exception. </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Unable to process parts as no multi-part configuration has been provided
  at 
  org.apache.catalina.connector.Request.parseParts(Request.java:2669)
  at org.apache.catalina.connector.Request.getParts(Request.java:2636)
  at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1083)
  at javax.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:347)
  at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:85)
  ... 32 common frames omitted
  </code></pre>
  
  <p>I  have tried all different things like setting properties in application.properties and also create be config bean.Please see below.
  I really appreciate if some one can help me to resolve this issue.</p>
  
  <p>Approach 1.</p>
  
  <pre><code>spring.http.multipart.enabled=true
  spring.http.multipart.max-file-size=1MB
  spring.http.multipart.max-request-size=10MB
  spring.http.multipart.resolve-lazily=false
  </code></pre>
  
  <p>Approach 2.</p>
  
  <pre><code>@Configuration
  public class MultiPartConfig {
  
    @Bean
    public MultipartConfigElement multipartConfigElement() {
      MultipartConfigFactory factory = new MultipartConfigFactory();
      factory.setMaxFileSize(1024L);
      return factory.createMultipartConfig();
    }
  }
  </code></pre>
  
  <p>My API endpoint.</p>
  
  <pre><code>@POST
  @Path("/picture")
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  public Response loadFile(@FormDataParam("file") InputStream file,
                           @FormDataParam("file") FormDataContentDisposition fileDisposition,
                           @Context HttpServletRequest request) {
  </code></pre>