If you're using IIS 7, a lot of answers online seem to point to increasing the maxAllowedContentLength attribute for the requestLimits element in the web.config.
Others also say if you're using IIS 6, you need to increase the maxRequestLength attribute for the httpRuntime element, also in the web.config.
I had to do both.
Within <system.web>, add:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" /> |
And within <system.webServer>, add:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<security> | |
<requestFiltering> | |
<requestLimits maxAllowedContentLength="1073741824" /> | |
</requestFiltering> | |
</security> |
Both of these values must match. In this case, my max upload is 1024 megabytes.
maxRequestLength has 1048576 KILOBYTES, and maxAllowedContentLength has 1073741824 BYTES.
It's quite easy to overlook this difference in requirements for each attribute, and mismatching these values can cause other errors.
I also answered this question on StackOverflow.