0

In our ASP.NET application some users hit maxAllowedContentLength limit (which is set to 32 megabytes in our application) when sending large POST requests.

Suppose we just blindly increase the limit to half gigabyte - what problems should be expect? How do we know the safe value for this limit?

sharptooth
  • 167,383
  • 100
  • 513
  • 979
  • Not a **best practice** answer, but some useful info here http://stackoverflow.com/questions/4022434/how-to-set-the-maxallowedcontentlength-to-500mb-while-running-on-iis7 – Christian Phillips Aug 05 '13 at 14:18

1 Answers1

0

You really don't want to bump this up site wide as it opens you up to DOS attacks using very large sets of data.

The easiest solution is to simply declare a <location> element for the specific endpoint you are uploading data to, and set the limit to be higher there.

Josh
  • 44,706
  • 7
  • 102
  • 124
  • Okay, so I declare `` and set the limit to half gigabyte - should I expect any problems? – sharptooth Aug 05 '13 at 14:17
  • Yes, your connection will probably time out before then. By default, ASP.Net sets the connection timeout to 110 seconds. – Josh Aug 05 '13 at 14:18