60

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.

5
  • 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. Commented Sep 17, 2014 at 19:36
  • @Shilpa, do you got the solution ? if yes, please share it with me. Thank you. Commented Jan 19, 2015 at 10:08
  • 2
    @kevin, please try by adding below statement in <system.web> tag in your web.config file- <httpRuntime executionTimeout="999999" maxRequestLength="1024000" requestValidationMode="2.0" /> Commented Jan 19, 2015 at 10:20
  • Oh it doesn't work for me. Anyway thank you. Commented Jan 19, 2015 at 10:52
  • @kevin did you find any solution? As Shilpa suggested, I tried, but it didn't work for me either. I also have a similar scenario, where there are no file uploads, just working with text data. Commented Sep 3 at 5:53

7 Answers 7

66

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.

Sign up to request clarification or add additional context in comments.

7 Comments

I just confirmed that this was the fix! After a postback with .NET webforms in IIS7, if the page idle for 90 seconds and then I did another postback I would get the request entity is too large error. Hopefully this will help someone else. whew!
is it this one ? <serverRuntime uploadReadAheadSize="524288000"/>
yes, that would be the web.config entry. I configured through IIS.
This helped a lot but the link provided seems to be broken. :(
YOU saved my life. Thanks dude.
|
41

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.

2 Comments

The error stopped after following your fix. Thanks.
tks, making this works for me
24

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> 

2 Comments

The second one helped
The second one actually fixed the problem for me as well
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

Comments

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 

1 Comment

It seems that the value could be 334217728 as mentioned in this answer provided above
3

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"

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.