I am trying to send one image from canvas and save it at server using ajax. My Jquery code is like:
$(document).ready(function () {
$("#UpLoad").click(function () { // trick by a button
var canVas = $('#Canvas')[0];
var dataURL = canVas.toDataURL();
$.ajax({
type: "POST",
url: 'savePicture.php',
data: { imgBase64: dataURL },
cache:false,
success: function (data) {
console.log("success");
console.log(data);
},
error: function (data) {
console.log("error");
console.log(data);
}
});
});
});
But when I checked with the console, i sent a blank data file (since I console log the data I was sending.
Can anyone help? Thanks.