title: Decoding a canvas todataURL
body: <p>I'm having difficulty using data created with canvas's todataurl() method. Currently my code sends the resulting data to my php server which uses the file_put_contents() method to create a file to store that data. Now if I cut and paste the resulting gibberish from the file into an image tag src it works fine and displays properly so I assume so far everything is peachy. </p>
  
  <p>But I keep running into issues when I try to use the code in JS. I've tried php's base64_decode method but kept getting currupt files. I found this code:</p>
  
  <pre><code>&lt;?php
    $encodedData = str_replace(' ','+',$encodedData);
    $decocedData = base64_decode($encodedData);
  </code></pre>
  
  <p>and still got currupted files. Ideally I'd like to create a .png file with it but I'd settle for just processing the data file again in JS. Any help greatly appreciated. </p>