title: How to parse and use base64 encoded image in play framework?
body: <p>I am using cropit(<a href="http://scottcheng.github.io/cropit/" rel="nofollow">http://scottcheng.github.io/cropit/</a>) tool on client side to crop images. It crops images and returns image in 'data:image/png;base64' format. Now i need this to be sent to play framework.</p>
  
  <p>header/payload preview:</p>
  
  <pre><code>------WebKitFormBoundaryXnMMA8dXWah4PjT9
  Content-Disposition: form-data; name="question"
  
  test new poll?
   ------WebKitFormBoundaryXnMMA8dXWah4PjT9
      Content-Disposition: form-data; name="pollImageBase64"
  
      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaQAAAExCAYAAAAz59bFAAAgAElEQVR4Xuy9B3Qs53Um+FVVdyN3N3J6iZmi+PgeSTFJtKWRaK9lW+OdXWssUZGUFWdndz1nnY6PPWMfWyOtPeNsS7IpM0mWf
  </code></pre>
  
  <p>What should be the form mapping?</p>
  
  <pre><code>val newPollForm = Form(
      mapping(
         "question" -&gt; nonEmptyText, 
        "pollImageBase64" -&gt; optional(text) //doesn't work and returns none
      )(NewPollItem.apply)(NewPollItem.unapply)
    )
  </code></pre>
  
  <p>Once i have received the pollImageBase64 as string of base64, how do i use it and save the image in scala/play framework?</p>