Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 422 Vote(s) - 3.41 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maximum request length exceeded.

#1
I am getting the error **Maximum request length exceeded** when I am trying to upload a video in my site.

How do I fix this?
Reply

#2
There's an element in web.config to configure the max size of the uploaded file:

<httpRuntime
maxRequestLength="1048576"
/>
Reply

#3
It may be worth noting that you may want to limit this change to the URL you expect to be used for the upload rather then your entire site.

<location path="Documents/Upload">
<system.web>
<!-- 50MB in kilobytes, default is 4096 or 4MB-->
<httpRuntime maxRequestLength="51200" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<!-- 50MB in bytes, default is 30000000 or approx. 28.6102 Mb-->
<requestLimits maxAllowedContentLength="52428800" />
</requestFiltering>
</security>
</system.webServer>
</location>
Reply

#4
I don't think it's been mentioned here, but to get this working, I had to supply both of these values in the web.config:

In `system.web`

<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

And in `system.webServer`

<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>

**IMPORTANT** : Both of these values must match. In this case, my max upload is 1024 megabytes.

maxRequestLength has *1048576 KILOBYTES*, and maxAllowedContentLength has *1073741824 BYTES*.

I know it's obvious, but it's easy to overlook.
Reply

#5
If you have a request going to an application in the site, make sure you set maxRequestLength in the root web.config. The maxRequestLength in the applications's web.config appears to be ignored.
Reply

#6
It bothered me for days too.
I modified the Web.config file but it didn't work.
It turned out that there are two Web.config file in my project,
and I should modified the one in the **ROOT** directory, not the others.
Hope this would be helpful.
Reply

#7
I can add to config web uncompiled

<system.web>
<httpRuntime maxRequestLength="1024" executionTimeout="3600" />
<compilation debug="true"/>
</system.web>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576"/>
</requestFiltering>
</security>
Reply

#8
I was tripped up by the fact that our web.config file has multiple system.web sections: it worked when I added < httpRuntime maxRequestLength="1048576" /> to the system.web section that at the configuration level.
Reply

#9
I had to edit the `C:\Windows\System32\inetsrv\config\applicationHost.config` file and add `<requestLimits maxAllowedContentLength="1073741824" />` to the end of the...

<configuration>
<system.webServer>
<security>
<requestFiltering>

section.

As per [This Microsoft Support Article][1]


[1]:

[To see links please register here]

Reply

#10
To summarize all the answers in a single place:

<system.web>
<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576"/>
</system.web>

<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>

Rules:

- maxRequestLength (expressed in kb) value must match
maxAllowedContentLength (expressed in bytes).
- most of the time your system.web section may already contains an "httpRuntime". set your targetFramework to the version of your .net used.

Notes:

- default value for maxRequestLength is 4096 (4mb). max value is 2,147,483,647
- default value for maxAllowedContentLength is 30,000,000 (around 30mb). max value is 4,294,967,295

more info [MSDN][1]


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through