title: Spring MVC File upload return - 415 Unsupported Media Type
body: <p>I'm writing a web service to upload a image/video file to the server. Every time I call my upload web service from postman, it return <strong>415 Unsupported Media Type</strong>.
  Here is what I have done.</p>
  
  <p>In my controller:</p>
  
  <pre><code>@POST
  @Path("/upload")
  @Produces(MediaType.MULTIPART_FORM_DATA)
  public Response upload(@RequestParam("file") MultipartFile files) {
      Response.ResponseBuilder rb;
  
      rb = Response.status(Response.Status.OK);
      rb.entity(new ResponseWrapper&lt;String&gt;(SUCCESS, ""));
      return rb.build();
  }
  </code></pre>
  
  <p>application context:</p>
  
  <pre><code>&lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
      &lt;property name="maxUploadSize" value="10000000"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I have already added   <code>commons-fileupload-1.2.2.jar</code> &amp; <code>mimepull.jar</code></p>
  
  <p>When I call the web service I get the following console log.</p>
  
  <pre><code>    com.sun.jersey.spi.container.ContainerRequest getEntity
  SEVERE: A message body reader for Java class org.springframework.web.multipart.MultipartFile, and Java type interface org.springframework.web.multipart.MultipartFile, and MIME media type multipart/form-data; boundary=--------------------------410903058421289672087091 was not found.
  The registered message body readers compatible with the MIME media type are:
  multipart/* -&gt;
    com.sun.jersey.multipart.impl.MultiPartReaderServerSide
  */* -&gt;
    com.sun.jersey.core.impl.provider.entity.FormProvider
    com.sun.jersey.core.impl.provider.entity.StringProvider
    com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
    com.sun.jersey.core.impl.provider.entity.FileProvider
    com.sun.jersey.core.impl.provider.entity.InputStreamProvider
    com.sun.jersey.core.impl.provider.entity.DataSourceProvider
    com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
    com.sun.jersey.core.impl.provider.entity.ReaderProvider
    com.sun.jersey.core.impl.provider.entity.DocumentProvider
    com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
    com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
    com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
    com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
    com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
    com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
    com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
    com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
    com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
    com.sun.jersey.core.impl.provider.entity.EntityHolderReader
    com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
    com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
    com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
  </code></pre>
  
  <p>I've tried many things digging the internet, still dosnt'e work. Help is appreciated.</p>