Unable to to send Image data via AJAx to servlet -
i using following ajax code send data servlet. unable figure out why data not being sent. servlet gets invoked, data null. base 64 encoded image data html canvas.
$.ajax({ contenttype: 'text/plain', data: { 'image': uri }, datatype: 'application/x-www-form-urlencoded', success: function(data){ alert("success"); }, error: function(){ alert("sorry failure"); // callback in case of error }, type: 'post', url: 'saveimageservlet' }); server side code looks
string imagedata = request.getparameter("image"); the base64 encoded data there print alert. not issue.
the ajax issue never got solved. however, found way send base64 image data servlet. appended hidden field , sent regular form field.
Comments
Post a Comment