title: multipart/form-data file upload + other parameters in Jersey
body: <p>I have a web form which contains a file upload option and a host of other input parameters.  I'm looking for some way to handle this with a Jersey request handler where the method parameters would be the file input, and "all other parameters".</p>
  
  <p><a href="https://stackoverflow.com/questions/27609569/file-upload-along-with-other-object-in-jersey-restful-web-service">This question</a> explains that I can't get the other parameters into a custom model object, because the browser sends them as separate multipart objects.  The next thing I tried was retrieving the other parameters in a <code>MultivaluedMap</code>:</p>
  
  <pre><code>@POST
  @Produces("text/html; charset=\"UTF-8\"")
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  public Page handlePost(@FormDataParam("icon") InputStream iconInputStream,
          @FormDataParam("icon") FormDataContentDisposition iconContentDispositionHeader,
          MultivaluedMap&lt;String, String&gt; formParams) {
      ...
  }
  </code></pre>
  
  <p>Unfortunately this does not work either.</p>
  
  <p>There are about 20 other parameters in the form (one of which is a multiselect-option), so I wouldn't want to handle them one-by-one as method parameters.  Is there any way in which I could get all the other parameters in a single object from which they could be queried?</p>