title: Grails - Fails to submit base64 img
body: <p>I need to make ajax submit to submit some data include a base64 string of the image, which is render from canvas.</p>
  
  <p>When submit I look in the network panel of Chrome inspector and everything look fine, in "form data" it list all the data that I want to submit.</p>
  
  <p>But in Grails I cannot get the data, there is nothing in the <code>params</code>, just the controller name and action name. Thus everything I get with simple <code>params.dataName</code> is null.</p>
  
  <p>I guess there is something with the size of the post request, but I'm not so sure as I have done this before without ajax.</p>
  
  <p>This is my code for upload with jquery ajax:</p>
  
  <pre><code>var imgBase64String = canvas.toDataURL("image/png");
  imgBase64String = imgBase64String .replace('data:image/png;base64,', '');
  var submitData = $(form).serializeArray();
  submitData.push({name: "webImage", value: imgBase64String })
  $.ajax({
      type: 'POST',
      url: '${createLink(action: 'myAction')}',
      data: submitData,
      dataType: "html",
      success: function(data){//Success code},
  });
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>My code on the server side, it fails at the simple step to retrieve <code>params</code> data:</p>
  
  <pre><code>def myAction= {
          def paramData = params
          log.info "paramData: " + paramData
  
          def url = params.url
          def email = params.email
          def webImage = params.webImage
          log.info "param: url = " + url
          log.info "param: email = " + email
          log.info "param: webImage = " + webImage
  
          //Other implement code      
  }
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>2012-10-08 16:31:28,988 [http-bio-8080-exec-5] INFO  myController  - paramData: [action:myAction, controller:myController]
  2012-10-08 16:31:28,989 [http-bio-8080-exec-5] INFO  myController  - param: url = null
  2012-10-08 16:31:28,989 [http-bio-8080-exec-5] INFO  myController  - param: email = null
  2012-10-08 16:31:28,989 [http-bio-8080-exec-5] INFO  myController  - param: webImage = null
  </code></pre>
  
  <p>The size of the base64 image I'm trying to submit is 1998720, don't know if this matter.</p>
  
  <p>Many thanks.</p>