I am trying to upload files that are 6mb in size. The web config is set as follows:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer>
I keep getting this error : Maximum request length exceeded.
Is there something that I am missing?
CodePudding user response:
In machine.config 4MB is set as default, but you can override it in you web.config file.
Try adding this:
<configuration>
<system.web>
<httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>
</configuration>
CodePudding user response:
Ok so basically I figured that in my case even when editing the webconfig file and its maximum content length, it doesn't really work if you do not set your IIS settings correctly.
To do this:
go on the specific website you want to edit in IIS
select configuration Editor
set the section to - system.web/httpRuntime
set the MaxRequestLength in kilobytes. You can use this tool to make the conversion from kb to mb and vice versa easier https://www.unitconverters.net/data-storage/kb-to-mb.htm
Don't forget to click on apply in the right tab in IIS.
Retry and hope for the best :)
CodePudding user response:
Please set 'MaxRequestLength' property in httpRuntime section of web.config to a higher value. Please note that the unit for this property value is KB. The default is 4096 KB = 4 MB