In IIS, the maximum request size is 4Mb. If you try to upload a file one byte larger, you will get a 404 error.
You need to modify the request limits to allow for larger file uploads. That means modifying your
web.config
file in two places:
<configuration>
<system.web>
<httpRuntime maxRequestLength="10240" />
</system.web>
</configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576" />
</requestFiltering>
</security>
</system.webServer>
NB: The setting under
system.web
is in
kilobytes, whereas the one under
system.webServer
is in
bytes. So to make them match, the second needs to be equal to
1024
× the first.
With this config in place, you will be able to upload files up to 10Mb. If you need to support larger files, then increase the values - you can set any value up to approximately 2Gb.