HTTP 413 Request Entity too Large - Can't upload large files using IIS6

Well, here's a new one I ran across recently.  My customer was trying to upload some files using Coldfusion by doing a simple post and was getting a HTTP 413 response when the files were larger than 128K.  IIS6 uses a new metabase property called UploadReadAheadSize when passing data to an ISAPI extension.  In this particular case the customer was using CAC (client access certs) and so the SSL preload was using this property to determine the maximum buffer size for the incoming request.  The default size for this buffer is 48k, which was added to prevent anonymous DOS attacks by uploading very large garbage files. 

The fix is simply to up the size of the UploadReadAheadSize metabase property.  One thing I would like to point out is an error in the technet documentation that explains how to do this (link below).  The following link instructs you to set the size as follows:

cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 200

Which should read:

cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 204800

The metabase setting is represented in bytes, not KB as the technet article would suggest.  You can change this setting up to 4GB although you probably wouldn't want to do so unless you had a compelling business need.  Of course a site that required authentication would be an effective way of limiting the chances of DoS, so if you do need to up this limit, you should consider requiring client authentication to connect. 

Client cannot renegotiate request and returns an HTTP 413 error (IIS 6.0)
https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/7e0d74d3-ca01-4d36-8ac7-6b2ca03fd383.mspx?mfr=true 

Other useful related links:

UploadReadAheadSize Metabase Property

https://technet.microsoft.com/en-us/library/cc728324(v=WS.10).aspx

HTTP/1.1 200 OK

Comments

  • Anonymous
    April 10, 2009
    Jiruss, thanks very much. Your tip worked perfectly!

  • Anonymous
    August 29, 2010
    Hi I tried the above but I still encounter HTTP 413

  • Anonymous
    August 29, 2010
    I have set up SSO with IIS and tomcat. tripled the value of uploadreadaheadsize Also set SSLAlwaysNegoClientCert to true Still encountered HTTP 413

  • Anonymous
    October 05, 2010
    since its still present. can  we just "REPLACE" the message to atleast have a more user friendly message like "Server is currently busy, Please try again in a few minutes." ... I tried try catch in server side code and it didnt catch it... so any ideas how to catch this ???

  • Anonymous
    October 14, 2010
    PLease remember: YOu have to replace the "1" with your Website-ID!! w3svc/1/uploadreadaheadsize 204800 w3svc/2/uploadreadaheadsize 204800 w3svc/3/uploadreadaheadsize 204800 w3svc/181/uploadreadaheadsize 204800 etc

  • Anonymous
    December 14, 2010
    For IIS7, please see blogs.iis.net/.../iis7-tweet-1-setting-uploadreadaheadsize.aspx adsutil.vbs is no longer supported by IIS7, it seems

  • Anonymous
    November 15, 2012
    Thanks Jimmie , It solved my problem in case of uploading files via HTTPS (I got this particular issues for HTTPS) After increasing uploadreadAheadSize property is started working . Thanks a lot ........................

  • Anonymous
    January 26, 2013
    i am trying to fill in a form online but when i send it i only receive the following message.Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 413

  • Anonymous
    January 26, 2013
    Issac, Is this your web site or are you using a 3rd party site and getting this error. Unless you are the owner/admin of the site, there is nothing you can do except contact the site tech support for help. If this is your own site, then look at the setting I mentioned above and also try setting the maxrequestlength property to a larger value. For how, please refer to this: msdn2.microsoft.com/.../e1f13641.aspx

  • Anonymous
    January 26, 2013
    Apologies, the link should be - msdn.microsoft.com/.../e1f13641(v=VS.100).aspx

  • Anonymous
    January 27, 2013
    Jimmie this is not my website but Emirates group website and there are application i need to fill and submit the online application.

  • Anonymous
    January 28, 2013
    Issac, You will need to contact the site owner/support for this. The only thing you can do on the client side is post less data. Regards

  • Anonymous
    February 24, 2014
    The correct link for UploadReadAheadSize Metabase Property is technet.microsoft.com/.../cc728324(v=WS.10).aspx

  • Anonymous
    February 24, 2014
    I have corrected the links Editor. Thanks.

  • Anonymous
    March 25, 2014
    Is this article applicable for IIS 7. I am recieving similar errors in IIS 7. The error text is - "The remote server returned an unexpected response: (413) Request Entity Too Large."

  • Anonymous
    March 25, 2014
    Hello Siva, This applies to IIS7/7.5 as well. Here are the instructions. IIS 7+ : Launch "Internet Information Services (IIS) Manager" Expand the Server field Expand Sites Select the site you want to make the modification for. In the Features section, double click "Configuration Editor" Under "Section" select: system.webServer -> serverRuntime Modify the "uploadReadAheadSize" section (This value should be in Bytes) Click Apply Do an IIS Reset

  • Anonymous
    May 19, 2014
    Da tutte le note che ho letto, non sono riuscito a capire cosa dovrei fare e/o dove operare per superare il seguente messaggio di errore : "Request  Entity  Too  Large" improvvisamente apparso e che non mi fa aprire una pagina di un sito

  • Anonymous
    September 07, 2014
    No one admits to changing anything but we had upload routine from hundreds of sites start failing.  This error started popping up after we did testing with certificate for SSL.  After finding Jimmie Ru reference to the setting checked and it was 49451.  Obviously not large enough for our needs so modified and everything works again.

  • Anonymous
    December 23, 2014
    I spent whole day trying to fix this issue and finally run into the Jimmie Ru's solution. That just did a magic. Thanks for posting it Jimmie, it saved my day.

  • Anonymous
    January 12, 2015
    Jimmie - You are my hero of the day! Thanks man

  • Anonymous
    March 16, 2015
    I have increased the uploadReadaheadsize value upto 104857600 bytes but still encountering the same error i.e. Request Entity too large. I am also using a web service which is used to upload the documents. Please help

  • Anonymous
    April 22, 2015
    Huge problem with 413 message when trying to upload a 1.4Mb Joomla extension. Tried all sorts of recommended fixes to no avail. Turned out my VPN was the culprit. Turned it off and the file uploaded and installed without a problem.

  • Anonymous
    January 28, 2016
    If it was nginx then follow this tutorial - atulhost.com/fix-nginx-error-413-request-entity-too-large