के साथ विफल रहता है मैं JSON डेटा को एएसपी.नेट एमवीसी 2 सर्वर पर पोस्ट कर रहा हूं। मैं बड़े JSON तारों को पोस्ट कर रहा हूं (जिसमें बेस 64-एन्कोडेड फ़ाइल स्ट्रीम शामिल है, स्थानीय फ़ाइल सिस्टम से पढ़ा जाता है)। JQuery AJAX कॉल लगभग 2.5 एमबी के आकार के आकार के लिए ठीक काम करता है। एक बार इस आकार से ऊपर AJAX कॉल विफल रहता है (नियंत्रक को कभी नहीं मिलता है)। मैं बिल्कुल पता नहीं लगा सकता कि त्रुटि क्या है - यह त्रुटि चर को पॉप्युलेट नहीं करता है।jQuery .ajax पोस्ट बड़े JSON ऑब्जेक्ट
ajax कॉल इस प्रकार है:
$.ajax({
type: "POST",
dataType: 'json',
timeout: 10000,
url: "/Molecule/SaveMolecule",
data: { jsonpost: postdata, moleculetype: _moleculeType, moleculefilestream: _moleculefilestream, changedproducts: stringifiedChangedProducts }, // NOTE the moleculeType being added here
success: function (data) {
if (data.rc == "success") {
$.log('ServerSuccess:' + data.message);
molecule_updateLocalInstance();
_bMoleculeIsDirty = false;
if (bReturnToMoleculeList != null && bReturnToMoleculeList == true) {
navigator_Go('/Molecule/Index/' + _moleculeType);
}
else {
_saveMoleculeButtonFader = setTimeout(function() {
$('#profilesave-container').delay(500).html('<img src="/content/images/tick.png" width="32px" height="32px" /><label>' + _moleculeSingularTerm + ' was saved</label>').fadeIn(500);
_saveMoleculeButtonFader = setTimeout(function() { $('#profilesave-container').fadeOut(1000); }, 2000);
}, 500);
}
} else {
$.log('ServerUnhappy:' + data.message);
RemoveMoleculeExitDialog();
}
}
, error: function (jqXHR, textStatus, errorThrown) {
alert('Save failed, check console for error message:' +textStatus+' '+ errorThrown);
MarkMoleculeAsDirty();
$.log('Molecule Save Error:' + helper_objectToString(textStatus+' '+errorThrown));
}
});
जहां _moleculefilestream बड़े बेस 64 एन्कोडेड धारा है।
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000">
</jsonSerialization>
</webServices>
</scripting>
</system.web.extensions>
कोई भी किसी भी उज्जवल विचार मिल गया:
मेरे web.config में निम्नलिखित शामिल हैं?
यह चाल है - धन्यवाद! – Journeyman