The page was not displayed because the request ent

2019-01-23 09:07发布

问题:

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 huge amount of data, so basically I know the cause of the issue.

However I'm looking out for a working solution for this. Secondally when I did some Google on the issue I found this kind of problem generates when any large file is being uploaded.

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

回答1:

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.



回答2:

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



回答3:

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.