I have asp.net web api application hosted in IIS. This app has 100mb in <httpRuntime maxRequestLength=...
and in <requestLimits maxAllowedContentLength=...
. But sometimes client gets 413 Request entity too large
in resoponse for quite small requests. I saw some fixes like "just change uploadreadaheadsize". But actually for me this solution is not clear. Why do I face this error when request limits are configured properly?
Update1: one more detail - this app uses client certificates authentication.
Update2: I found this https://technet.microsoft.com/en-us/library/cc737382(v=ws.10).aspx
Asked
Active
Viewed 3,522 times
1

mtkachenko
- 5,389
- 9
- 38
- 68
1 Answers
1
Here you can find a description of reason for this problem. I set uploadreadaheadsize to 1 mb instead of default 49152 b. I used this powershell script:
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webserver/serverruntime" -name "uploadreadaheadsize" -value 1048576
Actually I think this script should work too (it's not so global):
Set-WebConfigurationProperty -PSPath "iis:\Sites" -location "sitename here" -filter "system.webserver/serverruntime" -name "uploadreadaheadsize" -value 1048576

Community
- 1
- 1

mtkachenko
- 5,389
- 9
- 38
- 68