Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the property in webconfig maxRequestLength measured

I would like to increase this value

 <httpRuntime maxRequestLength="2024000" executionTimeout="300"/> 

But i am not sure how it is measured, MB, KB? not sure. I would like to be able to accept requests up to 50 MB.

Regards

like image 772
user710502 Avatar asked Jul 11 '12 17:07

user710502


People also ask

What is maximum value for maxRequestLength?

HttpRuntime 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 maxRequestLength in web config?

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 Max request length?

2,147,483,647 bytes, since the value is a signed integer (Int32).


2 Answers

The property maxRequestLength indicates the maximum file upload size supported by ASP.NET. This limit can be used to prevent denial of service attacks caused by users posting large files to the server. The size specified is in kilobytes. The default is 4096 KB (4 MB). MSDN

For 50 MB you will need to set it to 51200.

<httpRuntime maxRequestLength="51200" executionTimeout="300"/> 

Edit based on comments

The OP does not ask about executionTimeout but @barnes did in comments below. I feel to add some details about executionTimeout as well which is other httpRuntime attribute.

executionTimeout:

Optional TimeSpan attribute. Specifies the maximum number of seconds that a request is allowed to execute > before being automatically shut down by ASP.NET. This time-out applies only if the debug attribute in the compilation element is False. To help to prevent shutting down the application while you are debugging, do not set this time-out to a large value. The default is "00:01:50" (110 seconds), MSDN.

like image 187
Adil Avatar answered Sep 19 '22 11:09

Adil


maxRequestLength is measured in kilobytes

maxAllowedContentLength is measured in bytes

like image 44
Chandan Y S Avatar answered Sep 17 '22 11:09

Chandan Y S