Hassan Siddiqui

Hassan Siddiqui

  • NA
  • 152
  • 14.7k

json not saving large amount of data to server

May 15 2017 6:43 AM
Dear reader thanks for your consideration 
 Here I want to ask Question that i am drawing visio like diagrams by using HTML5 canvas by using fabricjs canvas liabrary.
I drag drop diagrams  and then save them into text file on server side. The problem is that i am unable to save the objects more than 114. means when i draw a diagram and save it it will be saved successfully but if i dran approx 50 diagrams it not saved. 
i am saving using json.
see the link below 
http://prntscr.com/f80dgn 
diagrams shown in the above link are saved successfully but when i try to save the data after adding just 1 more diagram it will not save.
the neccessary json code is here. 
 
selectAllObjects(true);
// deactive all the objects (means if some are selected/Highlited will we in normal/deselect mode).
canvas.deactivateAll().renderAll();
var jsonCanvas = canvas.toDatalessJSON();
//alert(jsonCanvas);
var jsonData = JSON.stringify(jsonCanvas);
// alert('Total canvas objects: ' + canvas.getObjects().length);
//alert(jsonData);
// debugger
// $("#savestus").show();
// $("#savestus").html(" Saving...");
$.ajax({
type: "POST",
url: "page2Fabric.aspx/saveJsonData",
data: '{jsondata: "' + encodeURIComponent(jsonData) + '" }', //e
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
error: OnError
});
 
 
 The question like me is at .
http://stackoverflow.com/questions/28702533/ajax-call-working-normally-for-small-amt-of-data-but-not-working-for-large-data 

Answers (4)