1

While trying to post json object using:

$.ajax({
  url: baseUrl + 'Controller/SaveBase64Image',
  type: 'POST',
  contentType: 'application/json; charset=utf-8',
  data: '{ "imageData" : ' + imageData + '}'
});

I get the following error back from the server: "Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."

This error was partially answered RIGHT HERE.

My problem is that the serialized json object I am posting to a controller method gets automatically de-serialized in order to convert it to the correct object in the argument of the method.

Is there a way to override the class that handles this automatic de-serialization?

Thanks in advance!


After reading one of Cordova's articles on how to use the camera capture, they said that newer cameras have such high resolution that the base64 string is too large for the clientside javascript to send to server. They recommend another path of which I am working on right now. I will let you know when I have a solution.

Community
  • 1
  • 1
Brian
  • 310
  • 1
  • 4
  • 13
  • Hi @Brian I am now in the same situation . Did you finda solution , I tried webconfig change but it did not solve the problem . – katmanco Mar 03 '15 at 22:20
  • @katmanco or Brian, anyone of you got any solution ? Im facing same issue and changing of web.config didn't help. – Mox Shah Mar 19 '17 at 20:18
  • 1
    Hi @MoxShah you can check out this link I solved my problem this way. http://stackoverflow.com/a/28844157/1218551 – katmanco Mar 20 '17 at 08:46

0 Answers0