HTTP 错误 404.13 - 未找到,在 asp.net MVC 中上传大文件时
HTTP Error 404.13 - Not Found, when uploading big file in asp.net MVC
我希望我的 Web 应用程序在服务器上上传大的 zip 文件。这是我的代码逻辑:
@using (Html.BeginForm("AddApplication", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form" }))
{
<div class="form-group">
<span>PUT FILE HERE : <input style="min-width: 550px;" type="file" name="zippedApp" /></span>
</div>
}
后手c#代码:
[HttpPost]
public ActionResult AddApplication( string description, HttpPostedFileBase zippedApp)
{
//code
}
未达到 C# 函数...甚至在它进入我拥有的函数之前:
HTTP Error 404.13 - Not Found
所以我读了这个:
IIS7 - Webrequest failing with a 404.13 when the size of the request params exceeds 30mb
这让我觉得没有人真正知道答案。因为就我而言,我确定它与 MVC web.Config.
有关
我在我能找到的每个配置中添加了一堆 <httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" />
...但还没有成功。
您还需要为 IIS7+ 添加此内容
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->
</requestFiltering>
</security>
</system.webServer>
我希望我的 Web 应用程序在服务器上上传大的 zip 文件。这是我的代码逻辑:
@using (Html.BeginForm("AddApplication", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form" }))
{
<div class="form-group">
<span>PUT FILE HERE : <input style="min-width: 550px;" type="file" name="zippedApp" /></span>
</div>
}
后手c#代码:
[HttpPost]
public ActionResult AddApplication( string description, HttpPostedFileBase zippedApp)
{
//code
}
未达到 C# 函数...甚至在它进入我拥有的函数之前:
HTTP Error 404.13 - Not Found
所以我读了这个:
IIS7 - Webrequest failing with a 404.13 when the size of the request params exceeds 30mb
这让我觉得没有人真正知道答案。因为就我而言,我确定它与 MVC web.Config.
有关我在我能找到的每个配置中添加了一堆 <httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" />
...但还没有成功。
您还需要为 IIS7+ 添加此内容
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->
</requestFiltering>
</security>
</system.webServer>