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
It seems you have to get rid of the header that is prepended to the image data by the toDataURL() function.
On the client side you can strip off the header like this:
..
var data=canvas.toDataURL();
var output=data.replace(/^data:image\/(png|jpg);base64,/, "");
// now send "output" to the server
..
On the server side use this: