When I upload an image I had this error:
maximum request length exceeded
How can I fix this problem?
The default maximum filesize is 4MB - this is done to prevent denial of service attacks in which an attacker submitted one or more huge files which overwhelmed server resources. If a user uploads a file larger than 4MB, they'll get an error message: "Maximum request length exceeded."
HttpRuntime maxRequestLength Use the maxRequestLength of the httpRuntime element. The default size is 4096 kilobytes (4 MB).
The MaxRequestLength property specifies the limit for the buffering threshold of the input stream. For example, this limit can be used to prevent denial of service attacks that are caused by users who post large files to the server.
Add the following to your web.config file:
<configuration> <system.web> <httpRuntime maxRequestLength ="2097151"/> </system.web> </configuration>
This sets it to 2GB. Not certain what the max is.
You can increase the maximum length of requests in web.config, under <system.web>
:
<httpRuntime maxRequestLength="100000" />
This example sets the maximum size to 100 MB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With