title: Handle a FormData send from Ajax in a Java File
body: <p>I am sending a file via Ajax like this:</p>
  
  <pre><code>// Get the selected files from the input.
    var files = fileSelect.files;
  
  // Create a new FormData object.
    var formData = new FormData();
  
      // Add the file to the request.
      formData.append('photos[]', files[0], files[0].name);
  
  
    $.ajax({
        type:"POST",
        url:"URL,
        dataType:"json",
        headers : {"cache-control":"no-cache"},
        timeout : 12000,
        processData: false,
        data:{
            formdata:formData
       }
  </code></pre>
  
  <p>Now I want to work with the send file in my java class, in a ressource like this:</p>
  
  <pre><code>@PermitAll
  @POST
  @Path(URL)
  @Produces(MediaType.APPLICATION_JSON)
  public Map&lt;String, Object&gt; fileHandler(@FormParam("formdata") File formdata){   }
  </code></pre>
  
  <p>But accessing the file does not work,  <strong>@FormParam("formdata") File formdata</strong> seems to be wrong (or more things?).  I want to get access to this file in my ressource class somehow.  What am I doing wrong?  Maybe someone knows a better solution for this.</p>