0

I have sent the following ajax request:   

var formdata = new FormData($('#form_Id')[0]);
     
$.ajax({
   url: '/DematReport/DP24/ImportFile',
   type: "POST",
   processData: false,
   contentType: false,
   data: formdata,
   timeout: 5000,
   success: function (result) {
   }
});

And now I get an error that looks like this: request Entity too large|| file size 100MB

Is there an upper limit to the amount of data transmitted, or is there a way to circumvent it?

  • Yes it is possible. You need to add/change corresponding config to your web server and/or application. – Guru Stron Feb 06 '23 at 12:00
  • @GuruStron can you explain a bit more? or give any reference link?? In .net5 – Ishwor Khatiwada Feb 06 '23 at 12:04
  • 1
    I would start from [here](https://stackoverflow.com/questions/26723894/413-request-entity-too-large) or [here](https://stackoverflow.com/q/53428474/2501279). Other then that it is not enough info - ASP.NET "classic" or ASP.NET Core. How the app is hosted. – Guru Stron Feb 06 '23 at 12:05
  • @GuruStron public static IWebHost BuildWebHost(string[] args) { return WebHost.CreateDefaultBuilder(args) .UseStartup() .UseKestrel(options => { options.Limits.MaxRequestBodySize = long.MaxValue; }) .UseIISIntegration() .Build(); }  [10:56 AM] Ishwor Khatiwada [RequestSizeLimit(104857600)] to get 100MB uploads to that endpoint [11:00 AM] Ishwor Khatiwada [DisableRequestSizeLimit]  I have tried all of these but none worked for me.. moreover, i dont have web.config what can i do? – Ishwor Khatiwada Feb 07 '23 at 05:22
  • `UseIISIntegration` - seems that you are using IIS, so as I wrote before - you need to configure your web server (IIS in this case) also, IIS has it's own `web.config` – Guru Stron Feb 07 '23 at 16:48
  • https://stackoverflow.com/questions/4022434/how-to-set-the-maxallowedcontentlength-to-500mb-while-running-on-iis7 – Ishwor Khatiwada Feb 08 '23 at 07:08

0 Answers0