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 .
Thanks
Suresh Thakur
Asp.net IIS7 SSLno file uploadRequest Entity Too large 413 error
Please mark this post as Answer if it is of help to you!
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
Although it talks about error found during uploading files to the server, and from your description this isn't the case, verify that your
IISconfig 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
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.
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
UploadReadAheadSizemetabase property, which is used for ISAPI extensions.
For more details
Thanks
Suresh Thakur
Please mark this post as Answer if it is of help to you!
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
Marked as answer by Leo Tang - MSFT on Jul 07, 2010 03:48 PM
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
Please mark this post as Answer if it is of help to you!
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
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">
<system.webServer>
<asp />
</system.webServer>
</location>"
so you can write in the bottom-->(since it doesnt exist before --> and i write maxvalue)
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.
Suresh Thaku...
3 Posts
Request Entity Too large 413 error
Jul 02, 2010 06:08 PM|LINK
Hi,
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 .
Thanks
Suresh Thakur
Asp.net IIS7 SSL no file upload Request Entity Too large 413 error
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
ArieH
70 Posts
Re: Request Entity Too large 413 error
Jul 04, 2010 04:01 PM|LINK
Hi,
Haven't had much experience with SSL on IIS7.X, but from some research, i came upon some interesting findings:
Try looking into http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx
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
Arie H.
Suresh Thaku...
3 Posts
Re: Request Entity Too large 413 error
Jul 06, 2010 06:37 AM|LINK
Hi Arie,
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
Thanks
Suresh Thakur
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
ArieH
70 Posts
Re: Request Entity Too large 413 error
Jul 06, 2010 09:41 AM|LINK
Excellent !
Happy the issue is solved, and thanks for the extra clarification.
Im sure others will benefit from it :D
Take care,
Arie H.
Suresh Thaku...
3 Posts
Re: Request Entity Too large 413 error
Aug 05, 2010 05:01 AM|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
when you stop trying, you’ve stopped succeeding.” The joy is in the trying — knowing that you might fail sometime. If you want to succeed, you need to keep stretching yourself.
Piotr Owsiak
1 Post
Re: Request Entity Too large 413 error
Dec 19, 2011 06:17 PM|LINK
CAUTION!!!
The value is not in KB, it is in bytes as pointed out by Jimmie Russ in his blog post here http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx
.netdevelop
1 Post
Re: Request Entity Too large 413 error
Mar 29, 2013 08:04 AM|LINK
I had the same problem and setting the uploadReadAheadSize solved it
http://www.iis.net/configreference/system.webserver/serverruntime
" 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">
<system.webServer>
<asp />
</system.webServer>
</location>"
so you can write in the bottom-->(since it doesnt exist before --> and i write maxvalue)
<location path="THENAMEOFTHESITEYOUHAVE" overrideMode="Allow">
<system.webServer>
<asp />
<serverRuntime uploadReadAheadSize="2147483647" />
</system.webServer>
</location>
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 .....
ArieH
70 Posts
Re: Request Entity Too large 413 error
Mar 30, 2013 06:08 PM|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
Arie H.
P.S. Allways back up your config files.