0

When we are passing string data using post method, if the string size goes beyond 1 MB it is giving "Request Entity Too Large" error. While below 1 MB it is working properly.

We have web hosting plus in godaddy with Linux Cpanel.

Here is My code


$("#Exceldownload_jobAlloctn").click(function(){
    var getrowdata = $('#location_grid_for_hub').jqxGrid('getrows');
    var getrowdata = JSON.stringify(getrowdata);

    if($('#location_grid_for_hub').jqxGrid('getrows').length == 0)
                {
                    callnotify_alert("Error","No Data to Export",'danger');
                    return false;
                }
    else{
   
    //json.stringfy();
  //  console.log(tickets_jqxgrid_rows);
        $.ajax({
            headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            url: "/Exportdata",
            dataType: 'text',
            type: "POST",
           // cache:false,
           processData: true,
        //    contentType: true,
            data: {"grid_data":getrowdata },
            error: function (error) {

                   console.log(error);
            },
            success: function (data) {
                console.log(data);
                
               // excel_nm= data;
                var excel_nm= data;
                var link1 = document.createElement("a");
                document.body.appendChild(link1);
                link1.download = data;
                link1.title = data;
                link1.setAttribute("type", "hidden");
                link1.setAttribute("download", data);
                 var url=$("#excelfile_url").val();
                link1.href = url+excel_nm; 
                
                link1.click();
                document.body.removeChild(link1);
                }

        });
    }
    
    });

Even tried increasing post_max_size and upload_max_filesize, but no luck.

Aram
  • 1
  • 3
  • 1
    The `godaddy` tag (if you try to add one) states to ask your question on [server fault](https://serverfault.com/tour). The [tag:cpanel] tag also states that configuration for cpanel is *off topic* for SO. – freedomn-m Jul 12 '22 at 12:30
  • According to comments below https://stackoverflow.com/a/29734678/1427878 they apparently have `LimitRequestBody` set really low. – CBroe Jul 12 '22 at 12:31
  • @CBroe Yes i have gone through that question already, but it does not help. – Aram Jul 12 '22 at 12:35
  • @freedomn-m Can you edit the question and add godaddy tag – Aram Jul 12 '22 at 12:36
  • 1
    Tried it, that's where I got the message from to use server fault. – freedomn-m Jul 12 '22 at 12:39
  • Have you tried asking GoDaddy for support, to see if they will increase the upload limit? Or maybe you've bought a hosting plan which has some specific limitations. – ADyson Jul 12 '22 at 12:51
  • @ADyson Yes spoke to them, they told to increase post_max_size and upload_max_filesize, which already we have tried. They have no clue about LimitRequestBody. Now we cant go to new hosting provider all of sudden. Really stuck here. – Aram Jul 12 '22 at 13:01
  • You have to create a php user.ini https://community.godaddy.com/s/question/0D53t00006VmAmDCAV/increase-max-upload-and-max-post-size-in-php More answers here https://stackoverflow.com/questions/29490482/request-entity-too-large-in-godaddy-server Looks like you have to go to a dedicated server – Grumpy Jul 12 '22 at 15:19
  • Does anyone got the answer – Aram Jul 13 '22 at 12:40

0 Answers0