【问题标题】:Uploading Large File in C# & ASP.NET MVC在 C# 和 ASP.NET MVC 中上传大文件
【发布时间】:2021-01-06 05:57:14
【问题描述】:

我正在尝试使用 C# 和 ASP.NET MVC 上传文件,但出现此错误:

HTTP 错误 413.1 - 请求实体太大
请求过滤模块用于拒绝超过请求内容长度的请求。

这就是我配置 web.config 的方式:

<system.web>
    <authentication mode="None"/>
    <compilation debug="true" targetFramework="4.7.2"/>
    <httpRuntime targetFramework="4.7.2"  executionTimeout="3600" maxRequestLength="104857600" enable="true"/>
</system.web>

【问题讨论】:

标签: c# html asp.net-mvc


【解决方案1】:

For IIS7 and above, you also need to add the lines below:
 <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
   </security>
 </system.webServer>

【讨论】:

    猜你喜欢
    • 2014-08-06
    • 1970-01-01
    • 2010-10-16
    • 2014-08-22
    • 2010-11-05
    • 1970-01-01
    • 2012-08-30
    • 2012-03-04
    • 2023-04-03
    相关资源
    最近更新 更多