What is the default maximum request length in the .net kernel

I want to know what is the default maximum request length in the .net core.

I read from several links that the default limit is 4 MB for asp.net applications, and the same should apply here.

But when testing, I found that even without overriding the default limit, I can upload files about 14 MB in size, but this fails for files about 30 MB in size.

I know exactly how to increase this limit, but I want to know what is the default limit. Is there any C # code to check? Could not find related documentation.

+5
source share
3 answers

The default maximum file size appears to be at 28.6 MB when hosted on IIS. When placed in Kestrel, there should be no maximum file upload size (or, as the docs say).

Source: ASP.NET Core Documents

+3
source

The default maximum file size is 4 MB.

If you want to increase the download size, you can do it as follows:

Using useful application settings is in the configuration service method. In this example, upload a file up to 100 MB.

 services.Configure<FormOptions>(options => { options.MultipartBodyLengthLimit = 100000000; }); 
+1
source

It is possible that your execution timeout is short, besides the maximum length, you also need to take into account that the web page only runs for the maximum seconds of time. In php it is 60 seconds. For asp.net you can change web.config add this to httpRunTime

 <httpRuntime executionTimeout="300" 

where 300 is equivalent to 5 minutes or 300/60.

I hope this solves your problem and happy coding! =)

0
source

Source: https://habr.com/ru/post/1269744/


All Articles