7

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?

tereško
  • 58,060
  • 25
  • 98
  • 150
mare
  • 13,033
  • 24
  • 102
  • 191
  • 1
    Not sure but, maxRequestLength is in kb and maxAllowedContentLength is in bytes. Maybe a test file problem? – dotjoe Jul 02 '12 at 20:33
  • 5
    Check out this answer to a similar post. [Max Lengths][1] [1]: http://stackoverflow.com/questions/6327452/which-gets-priority-maxrequestlength-or-maxallowedcontentlength – Chris Holwerda Jul 02 '12 at 20:35
  • thanks Chris for pointing that out – mare Jul 03 '12 at 21:05

1 Answers1

6

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

Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117
Dave Black
  • 7,305
  • 2
  • 52
  • 41