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() m
//image sample
$baseFromJavascript = "data:image/png;base64,BBBFBfj42Pj4";
// remove the part that we don't need from the provided image and decode it
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $baseFromJavascript));