Web.config设置无法接受超过1 GB的文件大小

时间:2016-12-28 06:34:44

标签: c# asp.net angularjs asp.net-mvc file-upload

我正在尝试上传大小 1.10 gb 的csv文件,我想允许用户上传大小 10 gb 的文件。

Web.config设置

<system.web>
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime maxRequestLength="10240000" targetFramework="4.5" /> <!-- this will file upload up to 10 gb-->
  </system.web>
 <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="10240000" /><!-- iis setting to handle file upload up to 10 gb-->
      </requestFiltering>
    </security>
    <modules>
      <remove name="FormsAuthentication" />
    </modules>
  </system.webServer>

错误enter image description here

以上设置基于this reference

我正在使用ng-File Upload将文件上传到服务器。

2 个答案:

答案 0 :(得分:3)

增加maxAllowedContentLength的值。 maxAllowedContentLength的最大值为4,294,967,295字节= 3,99 gb。

答案 1 :(得分:2)

您可以将其设置为最大3.99 GB。根据{{​​3}} maxAllowedContentLength类型为MSDN,其最大值为4,294,967,295字节= 3.99 GB