c# - The page was not displayed because the request entity is too large on IIS

c# – The page was not displayed because the request entity is too large on IIS

c# – The page was not displayed because the request entity is too large on IIS

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.

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 youve got big files.

c# – The page was not displayed because the request entity is too large on IIS

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>

Related posts on c++  :

Leave a Reply

Your email address will not be published.