title: formdata via ajax with groovy
body: <p>I'm trying to transfer an  image-file and corresponding information via ajax to a groovlet-server. </p>
  
  <p>Problem:
  I can't get the data out of the HTTPServletRequest obect. </p>
  
  <p>Here is the Javascript-Code that I use to transfer the data:</p>
  
  <pre><code>$("#submitButton").click( function(){
          if ( submitButtonCondition == true ) {
  
              //Gathering Data                
              var enabledValue = false;
              if ($("#activate").val()){
                  enabledValue = true;
              }       
              var metadata = $("#metaTextarea").val();                                
              var inputFile = $("#fileInput")[0].files[0];
  
              // Creating FormData-Object filled with necessary Data
              var formData = new FormData();      
              formData.append('file', inputFile);
              formData.append('enabled', enabledValue);
              formData.append('metadata', metadata);
  
              // Sending FormData to Server
              $.ajax({
                  type : 'POST',
                  url : '/createNewEntry.groovy',
                  contentType: false,
                  processData: false,
                  data: formData,
                  success: function(resultData){  
                      console.log("Upload successful");
                  },
                  failure: function(resultData){
                      console.log("Upload failed");
                  }
              });
          }
      }); 
  </code></pre>
  
  <p>The only way of verifying if data has been send has been accessing the attached reader of the request object: <code>System.out.println(request.reader.text);</code></p>
  
  <p>Output looks like this:</p>
  
  <pre><code>------WebKitFormBoundaryzNUfRksUAVW2ioCa
  Content-Disposition: form-data; name="file"; filename="blatest.png"
  Content-Type: image/png
  
  
  ------WebKitFormBoundaryzNUfRksUAVW2ioCa
  Content-Disposition: form-data; name="enabled"
  
  true
  ------WebKitFormBoundaryzNUfRksUAVW2ioCa
  Content-Disposition: form-data; name="metadata"
  
  asdfasdfasdf
  ------WebKitFormBoundaryzNUfRksUAVW2ioCa--
  </code></pre>
  
  <p>So apparently the data has been transferred?
  Still, I'm struggling to get information out of methods <code>getParameter, getParameterMap, getParameterNames, getParameterValues</code> which all give me no output.</p>