Maximum request length exceeded.

前端 未结 14 2710
臣服心动
臣服心动 2020-11-21 07:37

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条回答
  • 2020-11-21 08:12

    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>
    
    0 讨论(0)
  • 2020-11-21 08:12

    maxRequestLength (length in KB) Here as ex. I took 1024 (1MB) maxAllowedContentLength (length in Bytes) should be same as your maxRequestLength (1048576 bytes = 1MB).

    <system.web>
       <httpRuntime maxRequestLength="1024" executionTimeout="3600" />
    </system.web>
    
    <system.webServer>
       <security>
          <requestFiltering>
              <requestLimits maxAllowedContentLength="1048576"/>
          </requestFiltering>
       </security>
    </system.webServer>
    
    0 讨论(0)
提交回复
热议问题