title: Multiple files upload in a REST service using Jersey
body: <p>Quite a few links here that suggest using <code>multipart/form-data</code> and how to get the file upload here. Couldn't really find one for a combination of multiple files uploaded via CURL command and to a REST service accepting <code>FormDataMultiPart</code>. </p>
  
  <p>The code in service currently looks like :</p>
  
  <pre><code>@javax.ws.rs.POST
  @javax.ws.rs.Path("/sample-bulk")
  @javax.ws.rs.Consumes(javax.ws.rs.core.MediaType.MULTIPART_FORM_DATA)
  public javax.ws.rs.core.Response bulkUpload(@FormDataParam("file") org.glassfish.jersey.media.multipart.FormDataMultiPart multiPart) {
      log.info("{} log", multiPart.getField("file"));
      return Response.ok().build();
  }
  </code></pre>
  
  <p>and the CURL I am trying to call the service is as :</p>
  
  <blockquote>
    <p>curl -X POST
    "<a href="http://localhost:37200/api/sample-bulk" rel="nofollow noreferrer">http://localhost:37200/api/sample-bulk</a>"
    -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/Users/naman/Desktop/Media/video.mp4;type=video/mp4"</p>
  </blockquote>
  
  <p>But it results in <code>multiPart</code> being <code>null</code> at the service and of course NPE. </p>
  
  <p>Anything silly that I've missed here?</p>