I am sending a base64 string which contains Imagedata to a vb.net webmethod by ajax.
function savethisimagenow() {
$('.piccropperdiv').croppie("result", { type: "canvas", format: "jpeg" }).then(function(ImageData){
//ImageData is a base64 string.
var pictureobj = { pictureobj: { picturedata: ImageData } };
$.ajax({
type: "POST",
url: '/CheemaWebServiceUtilities.asmx/saveprofilepicturefromcrop',
data: JSON.stringify(pictureobj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert('yay');
},
failure: function (response) {
alert('fail');
},
error: function (response) {
alert('error');
}
});
});
};
It works fine when the string i.e. Imagedata is short (small sized image),
but it shows error when string i.e. Imagedata it is too long.
Anyone out there to help me?