question

nutntion-5142 avatar image
0 Votes"
nutntion-5142 asked WuJohnnyYC-0765 commented

413 Request Entity Too Large

Hi all,

I have an application deployed on IIS, but I found that I can't upload anything larger than 50kb, If I upload more than 50kb I will get this error.

"Error in HTTP request, received HTTP status 413 (Request Entity Too Large)"

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YurongDai-MSFT avatar image
1 Vote"
YurongDai-MSFT answered WuJohnnyYC-0765 commented

Hi @nutntion-5142,

IIS has a limit for the size of the files users can upload to an application. If the file size exceeds the limit, the application will throw “Error in HTTP request, received HTTP status 413 (Request Entity Too Large)” error.

The default file upload size is 49 KB (49152 bytes). The application records the log below if user tries to upload a file that is bigger than this size.

225982-image.png

The reason for this issue with SSL sites is that the request body must be preloaded during the SSL handshake process.

Solution
The quickest solution is to increase the upload size limit. IIS uses uploadReadAheadSize parameter in applicationHost.config and web.config files to control this limit.

uploadReadAheadSize
Optional uint attribute.
Specifies the number of bytes that a Web server will read into a buffer and pass to an ISAPI extension or module. This occurs once per client request. The ISAPI extension or module receives any additional data directly from the client. The value must be between 0 and 2147483647.
The default value is 49152.
Server Runtime

Steps to change the value of this parameter:

  1. Open IIS Manager

  2. Select the site

  3. Double click “Configuration Editor”

  4. Select system.webServer and then serverRuntime

  5. Modify the uploadReadAheadSize value

  6. Click “Apply”

225966-image.png


You may also want to change maxRequestEntityAllowed parameter. It specifies the maximum number of bytes allowed in the request body.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.


Best regards,
Yurong Dai






image.png (33.7 KiB)
image.png (26.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

In my case, i actually had to lower it to the default value. :) thx for the info!

0 Votes 0 ·