I want to send a canvas image object to the server using ajax. After creating the canvas image
var dataURL = canvas.toDataURL();
$.ajax({
type: "POST",
url: "uploadProfPic",
data: { userId: user, imgBase64: dataURL }
})
in the controller I tried like
@RequestMapping(value = "/uploadProfPic",method = RequestMethod.POST)
public @ResponseBody uploadProfPic(@RequestParam(value="imageBase64", defaultValue="")String imageBase64, String userId){
return userId;
}
In @RequestParam what will i write to get the canvas object?