• Home
  • Jobs
  • coursesAndChallenges
  • Teachers
  • For business
  • Blog
  • ES/EN

0

18
Views
JQuery AJAX post issue while uploading the EXCEL file

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.

14 days ago ·

Santiago Trujillo

Answer question
Remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Startups
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.