title: base64 encoded PNG to Blob
body: <p>I am fiddling around with creating a Blob out of a base64 encoded PNG...</p>
  
  <pre class="lang-dart prettyprint-override"><code>  final FormData formData = new FormData();
    final String base64Image = "data:image/png;base64,iVBORw0K&lt;reduced the data.....&gt;gg==";
  
    final Blob blob = new Blob([base64Image],"image/png");
  
    formData.append('file', blob, "android.png");
  
    req.send(formData);
  </code></pre>
  
  <p>I don't know what I a doing wrong but the contents of blob is something but not the png I would like it to be.</p>
  
  <p>thx in advance...</p>
  
  <p>[<strong>Update</strong>]</p>
  
  <pre class="lang-dart prettyprint-override"><code>  final FormData formData = new FormData();
    final String base64Image = "iVBORw0KGgo&lt;...reduce data...&gt;kJggg==";
  
    // BTW: I used the Base64 from dart-sdk/io/base64.dart
    final List&lt;int&gt; intList = Base64.decode(base64Image);
    final Int8Array int8array = new Int8Array.fromList(intList);
    final String atobString = window.atob(base64Image);
  
    // Does not work
    // final Blob blob = new Blob([atobString]);
  
    // The same...
    // final Blob blob = new Blob([int8array]);
  
    formData.append('file', blob, "android.png");
    //formData.append('new-filename', "icon-share.png");
  
    req.send(formData);
  </code></pre>
  
  <p>I think the number of bytes generated by Base64.decode are OK. The filesize was 1003 bytes and decoding also produces 1003 bytes.</p>
  
  <p>[<strong>Update 2</strong>]
  Here is the source I am talking about:
  <a href="https://github.com/MikeMitterer/AndroidIconGenerator.DART/blob/master/test/src/restserver.dart" rel="nofollow">https://github.com/MikeMitterer/AndroidIconGenerator.DART/blob/master/test/src/restserver.dart</a></p>