IIS 7 and Above
Request Entity Too large 413 error
Last post Nov 15, 2013 03:23 AM by Sazul
Jul 02, 2010 07:08 PM|suresh thakur|LINK
I have developed my web application in ASP.Net and hosted on IIS 7 running on windows 2008 and we are using SSL to make secure connection.
On few pages, I am receiving error number 413: Request entity is too large. The error happens if user opens a page and wait for few minutes before pressing any button on webpage.
When user press a button on a page after few minutes once page is loaded- the error 413 appears-though error does not appear if I do not wait and works frequently on page.
On press of button page makes asynchronous call to server using update panel.The page contains 5 tabs and each tab having a gridview control which is loaded on load event of page and gridview page size is 10 for each grid.
Each grid is having its own update panel to refresh content. No other grid content is refreshing on click of button of a grid except its own.
I am not uploading any file on this page.
The same pages works fine on HTTP but not on HTTPS.
Please help me out, its very urgent to solve this issue .
Asp.net IIS7 SSL
no file upload
Request Entity Too large 413 error
Jul 04, 2010 05:01 PM|ArieH|LINK
Haven't had much experience with SSL on IIS7.X, but from some research, i came upon some interesting findings:
Try looking into
Although it talks about error found during uploading files to the server, and from your description this isn't the case, verify that your
IIS config is set with appropriate values.
Also, look into
http://www.developmentnow.com/g/59_2005_1_0_0_49331/IIS6-0-SSL-Breaks-down.htm, though its an old post and speaks of earlier versions of
IIS, quite a few settings from old
IIS days can still be found in today's IIS settings. I Would specifically point the answer made by David Wang about midway and the final result of that page.
Hope this gives you a starting point to figure whats not working :D
Jul 06, 2010 07:37 AM|suresh thakur|LINK
Thanks for quick reply.
When I was searching , I also come across such links saying to Reset UploadReadAheadSize value in host config file. But all of the post was giving this solution only if user is uploading a large file.
But your mentioned link http://www.developmentnow.com/g/59_2005_1_0_0_49331/IIS6-0-SSL-Breaks-down.htm has
helped me to understand that the same issue could also come when the page size itself is very large.
Because the request entity body will become large in both cases.
Anyway, setting uploadReadAheadSize in applicationHost.config file on IIS7.5 has resolved my issue.
Why this is happing on SSL? : Because during client renegotiation process,the request entity body must be preloaded using
SSL preload. SSL preload will use the value of the
UploadReadAheadSize metabase property, which is used for ISAPI extensions.
For more details
Jul 06, 2010 10:41 AM|ArieH|LINK
Happy the issue is solved, and thanks for the extra clarification.
Im sure others will benefit from it :D
Aug 05, 2010 06:01 AM|suresh thakur|LINK
Use appcmd.exe utility to set UploadReadAheadSize in applicationhost file. The size would be in KB.
Locate appcmd.exe in \windows\system32\inetsrv folder and run following command on command line tool
appcmd.exe set config -section:system.webserver/serverruntime/uploadreadaheadsize: 1048576 /commit:apphost
Dec 19, 2011 07:17 PM|piotr owsiak|LINK
The value is not in KB, it is in bytes as pointed out by Jimmie Russ in his blog post here
Mar 29, 2013 09:04 AM|.netdevelop|LINK
I had the same problem and setting the uploadReadAheadSize solved it
" The value must be between 0 and 2147483647."
its easy set it in applicationHost.config-fle
its located in -->WindowsFOLDER\System32\inetsrv\config (2008 server)
you must open it with notepad. do a Backup of the file first ...
according to the comments in config-->
"The recommended way to unlock sections is by using a location tag:
<location path="Default Web Site" overrideMode="Allow">
so you can write in the bottom-->(since it doesnt exist before --> and i write maxvalue)
<location path="THENAMEOFTHESITEYOUHAVE" overrideMode="Allow">
<serverRuntime uploadReadAheadSize="2147483647" />
if you put it last before </configuration> for example... you know where you have it....
Hope that solves your problems. Its an SSL issue for me .....
Mar 30, 2013 07:08 PM|ArieH|LINK
Even when a setting has a maximum value its not wise at all to use that max value.
So for future reference, what J.Russ wrote in his artice is extremely true:
The default size for this buffer is 48k, which was added to prevent anonymous DOS attacks by uploading very large garbage files.
Thus think of the normal files youre going to transfer, beyond a certain file size youre going to "abuse" your server resources and be in more risk of such attacks for no reason.
Safe Usage :D
P.S. Allways back up your config files.
Aug 21, 2013 04:38 PM|Avisek|LINK
I added like this but it didn't worked.
<location path="Default Web Site" overrideMode="Allow"> <system.webServer> <asp /> <serverRuntime uploadReadAheadSize="2147483647" /> </system.webServer> </location>
The <configSections> section controls the registration of sections. Section is the basic unit of deployment, locking, searching and containment for configuration settings. Every section belongs to one section group.
A section group is a container of logically-related sections. Sections cannot be nested. Section groups may be nested. <section name="" [Required, Collection Key] [XML name of the section]
allowDefinition="Everywhere" [MachineOnly|MachineToApplication|AppHostOnly|Everywhere] [Level where it can be set] overrideModeDefault="Allow" [Allow|Deny] [Default delegation mode] allowLocation="true" [true|false] [Allowed in location
tags] /> -->
Nov 15, 2013 03:23 AM|Sazul|LINK
Try using the following command in the Windows/System32/inetsrv. Hope this help.
appcmd.exe set config -section:system.webserver/serverruntime /uploadreadaheadsize:1048576 /commit:apphost