29

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

user710502
  • 11,181
  • 29
  • 106
  • 161

3 Answers3

50

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.

Adil
  • 146,340
  • 25
  • 209
  • 204
  • According to [MSDN](https://msdn.microsoft.com/en-IN/library/e1f13641(v=vs.85).aspx) `executionTimeout="HH:MM:SS"`. What is the unit in your case? – phougatv Jul 20 '16 at 10:14
  • 1
    It is in seconds, It is also in seconds from MSDN link you provided, executionTimeout="seconds" – Adil Jul 20 '16 at 10:20
  • Means we can either provide time total number of seconds or in "HH:MM:SS" format. Thanks – phougatv Jul 21 '16 at 05:53
  • 1
    Yes, example is given in the MSDN documentation, "The default is "00:01:50" (110 seconds)." – Adil Jul 21 '16 at 05:57
  • FWIW, it seems like Microsoft says kilobytes (1KB = 1,000 bytes) but everyone means kibibytes (1KiB = 1,024 bytes). And same with Megabytes (1MB = 1,000KB) vs. Mebibytes (1MiB = 1,024KiB). – iokevins Apr 10 '20 at 21:32
7

It accepts KB. For 50 MB, set it to

maxRequestLength="51200"
adiga
  • 34,372
  • 9
  • 61
  • 83
Waqar Janjua
  • 6,113
  • 2
  • 26
  • 36
6

maxRequestLength is measured in kilobytes

maxAllowedContentLength is measured in bytes

adiga
  • 34,372
  • 9
  • 61
  • 83
Chandan Y S
  • 968
  • 11
  • 21