title: Convert HTML5 Canvas into File to be uploaded?
body: <p>The standard HTML file upload works as follows:</p>
  
  <pre><code>&lt;g:form method="post" accept-charset="utf-8" enctype="multipart/form-data"  
       name="form" url="someurl"&gt;
  
      &lt;input type="file" name="file" id="file" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>In my case I loaded an image into a html5 canvas and want to submit it as a file to the server.
  I can do:</p>
  
  <pre><code>var canvas; // some canvas with an image
  var url = canvas.toDataURL();
  </code></pre>
  
  <p>This gives me a image/png as base64. </p>
  
  <p><strong>How can I send the base64 image to the server the same way it is done with the input type file?</strong> </p>
  
  <p>The problem is that the base64 file is not of the same type as the file, which is inside the input type="file". </p>
  
  <p><strong>Can I convert the base64 that the types are the same for the server somehow?</strong> </p>