Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maxRequestLength vs. maxAllowedContentLength on IIS 7.5

maxAllowedContentLength is supposed to work on IIS 7+ servers but apparently my server doesn't want to take this value into account when uploading (ASP.NET MVC 3 website). Now that I included maxRequestLength in web.config everything started to work and the value was applied. Yet everywhere everyone is saying that the maxAllowedContentLength is the right one.

Does anyone has an explanation for this behaviour?

like image 369
mare Avatar asked Jul 02 '12 19:07

mare


People also ask

What is the max value of maxRequestLength?

Use the maxRequestLength of the httpRuntime element. The default size is 4096 kilobytes (4 MB). Max value 2,147,483,647 kilobytes (~82 Terabyte).

What is the use of maxRequestLength?

The MaxRequestLength property specifies the limit for the buffering threshold of the input stream. For example, this limit can be used to prevent denial of service attacks that are caused by users who post large files to the server.

What is maxAllowedContentLength in web config?

The maxAllowedContentLength Request Filter is the maximum size of the http request, measured in bytes, which can be sent from a client to the server. Configuring this value enables the total request size to be restricted to a configured value.


1 Answers

Take a look at the link below - it explains the difference between the two. You'll need to set both if you are going to be uploading large files. Note that you can also nest this setting in a <location> tag so as not to apply the setting to the entire website (which I recommend).

Confusing required maxRequestLength and maxAllowedContentLength settings

like image 145
Dave Black Avatar answered Oct 20 '22 19:10

Dave Black