Maximum request length exceeded.

2018-12-31 02:08发布

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?

14条回答
春风洒进眼中
2楼-- · 2018-12-31 02:37

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.

查看更多
怪性笑人.
3楼-- · 2018-12-31 02:39

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

<httpRuntime 
    maxRequestLength="1048576"
  />
查看更多
登录 后发表回答