Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc MVC-System.Web.HttpException:超出最大请求长度_Asp.net Mvc - Fatal编程技术网

Asp.net mvc MVC-System.Web.HttpException:超出最大请求长度

Asp.net mvc MVC-System.Web.HttpException:超出最大请求长度,asp.net-mvc,Asp.net Mvc,我的web.config中有以下代码 <system.webServer> <modules> <remove name="FormsAuthentication" /> </modules> <security> <requestFiltering> <requestLimits maxAllowedContentLength="107374182

我的web.config中有以下代码

  <system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
    </modules>

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

    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

我有一个页面,允许用户上传多达五张图片。在测试这一点时,我试图上传五个图像,总计约16MB,我得到的最大请求长度超过了错误。还有什么我需要设置的吗?

试试:

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="1073741824" />
    </system.web>
    <system.webServer>
       <!-- Your other settings -->
    </system.webServer>
</configuration>


除了你设定的。您可能还需要查看executiontimeout(也是的一个属性)。

检查此项:,似乎重复1073741824是1GB,因此您可能需要在两个设置上都进行检查?:-)