I have an issue with an mvc4 controller (only on a production azure web role)
I have a large svg image about 7mb that I am trying to send back to the server. I have tried 2 approaches both without any luck doing a full form post with the value of the svg file and also an ajax post. Both times the controllers parameter is always null.
I assume its because the size of the string i am trying to send is to big. Example of my code using the ajax approach.
$(".export").on("click", function () {
var chart = $("#barchart").data("kendoChart");
var svgString = chart.svg();
var exportFormat = $(this).data("format");
if(svgString!=""&&exportFormat!=""){
$.ajax({
type: "POST",
url: "../SendMyFile",
data: JSON.stringify(escape(svgString) + "&" + exportFormat),
contentType: 'application/json',
dataType: 'json',
Is there a config setting I need to do or is it a case of changing my code? I also made a modification to the web.config
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000">
</jsonSerialization>
</webServices>
</scripting>
Any help would be awesome!!
Beside altering your jsonSerialization
element, you have to also tweak the httpRuntime
and more precisely the maxRequestLength property. The default value is 4MB. And while you may have changed this for your local IIS, in Azure you have defaults unless explicitly overridden in your web.config.