52

I'm getting the following error while redirecting one page to another web page:

"the page was not displayed because the request entity is too large.".

The page from which I'm redirecting to another page contains a huge amount of data, so basically I know the cause of the issue.

However, I'm looking out for a working solution for this. Secondly, when I researched this issue I found such kind of problem generates when any large file gets uploaded.

But I'm not uploading any large file, its just the page itself contains large data. Prompt solution will be appreciated.

Shilpa Soni
  • 2,034
  • 4
  • 27
  • 38
  • I have the same issue with my users. No upload functionality, but periodically they get the error. It might have something to do with IIS and they stay on a certain page too long, walk away from their computers, then come back hours later and click a link. I can't duplicate the error. – JoshYates1980 Sep 17 '14 at 19:36
  • @Shilpa, do you got the solution ? if yes, please share it with me. Thank you. – kevin Jan 19 '15 at 10:08
  • 2
    @kevin, please try by adding below statement in tag in your web.config file- `` – Shilpa Soni Jan 19 '15 at 10:20
  • Oh it doesn't work for me. Anyway thank you. – kevin Jan 19 '15 at 10:52

7 Answers7

57

I think this will fix the issue if you have SSL enabled:

Setting uploadReadAheadSize in applicationHost.config file on IIS7.5 would resolve your issue in both cases. You can modify this value directly in applicationhost.config.

  1. Select the site under Default Web Site

  2. Select Configuration Editor

  3. Within Section Dropdown, select "system.webServer/serverRuntime"

  4. Enter a higher value for "uploadReadAheadSize" such as 1048576 bytes. Default is 49152 bytes.

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

Reference.

Ram
  • 15,908
  • 4
  • 48
  • 41
JoshYates1980
  • 3,476
  • 2
  • 36
  • 57
33

I got it working by doing the following

  1. Go to IIS.
  2. Click on the server name
  3. In the features (icons), chose the configuration editor.
  4. Click on the dropdowns on the top with Settings
  5. Traverse the path system.webServer -> security -> requestFiltering -> maxAllowedContentLength and set it to 334217728. (Then hit enter and then apply on the top right).

You can also restart the webserver for good measure. After that I could upload my 150k database to phpymyadmin.

I also set post_max size to 8000 in php.ini in programs/PHP/phpversion/php.ini

It may be overkill for the sizes but it gets the job done when you've got big files.

Soumen Mukherjee
  • 2,953
  • 3
  • 22
  • 34
19

For me, uploadReadAheadSize did not fix my issue.

I changed both of these settings in my asp.net web.config and finally the file uploaded for me:

<system.web>
  <system.webServer
<httpRuntime executionTimeout="999999" maxRequestLength="20000" requestValidationMode="2.0" /> <!-- 20 MB -->
</system.web>

  <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="20500000" />  <!-- 20.5 MB - making it match maxRequestLength to fix issue with uploading 20mb file -->
      </requestFiltering>
   </security>   
  </system.webServer>
Taylor Brown
  • 1,689
  • 2
  • 17
  • 33
4

Another possible cause is an Authentication setting. Within IIS7,

  1. Select the site under Default Web Site

  2. Select Authentication

  3. Select Windows Authentication and enable. Disable all others.

  4. While Windows Authentication is still selected, click on Advanced Settings in the Actions pane.

  5. Make sure Extended Protection is on Accept and check the Enable Kernel-mode authentication

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
JoshYates1980
  • 3,476
  • 2
  • 36
  • 57
4

I had the same error and the above fix did not work. I was only on HTTP (localhost) However this fixed the 413 error

Set-WebConfigurationProperty -filter /system.webserver/security/requestfiltering/requestLimits -name maxAllowedContentLength -value 134217728
DATEx2
  • 3,585
  • 1
  • 24
  • 26
  • It seems that the value could be 334217728 as mentioned in [this answer](https://stackoverflow.com/a/58039922/2803565) provided above – S.Serpooshan Jun 01 '22 at 06:27
2

I did the above but still had no joy.

What fixed the problem for me was also upping the request limits: - Select site in IIS manager - Click "Edit feature settings" from right hand menu - Insert 200000000 for "Maximum allowed content length"

Tel
  • 81
  • 4
1

In my case, the error occurred when downloading a file.

The reason was, that I had a code that explicitely sends an HTTP 413 to the client in an (erroneous) case.

(See here for details).

So be aware of the fact that setting an HTTP response code 413 in your code (or in a library that you are using) also can generate the OP's error message.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291