12-14-2011 01:32 PM
Hello, I'm having trouble sending the output of canvas.toDataURL to a web service.
var canvas = document.getElementById('signature-canvas');
var ctx = canvas.getContext("2d");
var image = canvas.toDataURL();
var image_b64str = image.replace(/^data:image\/\w+;base64,/, "");
When I try to send image_b64str to my web service call it is giving me error 500. Now, before you tell me it's a problem with the web service itself, please note that if I hard code a base 64 image like so:
var image_b64str = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH
The web service accepts it fine and does what it is supposed to.
Any ideas or advice?
Solved! Go to Solution.
07-24-2012 05:43 AM