【问题标题】:Web.config settings not working to accept file size with more than 1 gbWeb.config 设置无法接受超过 1 GB 的文件大小
【发布时间】:2017-05-12 09:57:38
【问题描述】:

我正在尝试上传大小为 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>

错误

以上设置基于this reference

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

【问题讨论】:

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


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    您可以将其设置为最大 3.99 GB。根据MSDNmaxAllowedContentLength的类型为uint,其最大值为4,294,967,295字节= 3.99 GB

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多