I am trying to pass an image through Ajax to my MVC Controller. Currently I am trying to pass it as a Base64 string but it is too long and is throwing Error 414 (Its around 33,000 characters).
The Base64 string comes from calling toDataUrl on a canvas I have, the canvas is a "screenshot" of the current browser window.
Is there a better way to pass the canvas image to my controller?
var imgBase64 = canvas.toDataURL('image/jpg').replace('data:image/png;base64,', '');
$.ajax({
url: "API Url - Actual URL is in code just removed here",
data: {
"imgBase64":imgBase64
},
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
type:"POST",
success: function(res){
console.log("Success");
}
});