My code snippet is below
function uploadFile(file, action){
var fd = new FormData();
fd.append('file_data', file);
$.ajax({
type: 'POST',
data: fd,
processData: false,
url: reload_url,
contentType: false,
async: false,
cache: false,
complete: function (xhr, status) {
if (status != 'success' ) {
console.log("Complete",xhr.response, status, file.name);
}
},
error:function(data){
console.log("Failed ",data);
alert("Failed to upload file");
},
timeout: 30000,
});
}
While I am posting the data with less file size(< 1MB) then it is working , But if the file is > 3MB then it is failing with error sig : net::ERR_CONNECTION_RESET And the status response is : "NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load
Can anybody please help on this issue.
Santiago Trujillo