在asp.net MVC中上传大文件时,出现HTTP错误404.13-未找到 [英] HTTP Error 404.13 - Not Found, when uploading big file in asp.net MVC

查看:147
本文介绍了在asp.net MVC中上传大文件时,出现HTTP错误404.13-未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的Web应用程序在服务器上上传大型zip文件.这是我的代码逻辑:

I want my web application to upload big zip file on the server. Here's my code logique :

@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#函数没有到达...甚至在进入我拥有的函数之前:

The C# function is not reached... before it even enters the function i have :

HTTP错误404.13-未找到

HTTP Error 404.13 - Not Found

所以我读了这篇文章:

IIS7-当请求参数的大小超过30mb时,Webrequest失败,并显示404.13

这让我感到没人真正知道答案.因为就我而言,我确定它与MVC web.Config有关.

And it makes me feel like no one really knows the answer. Because in my case i'm sure it is related to MVC web.Config.

我在我能找到的每一个配置中都添加了一堆<httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" />,但是还没有成功.

I added a bunch of <httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" /> in every pieces of config i could find... but no succes yet.

推荐答案

您还需要为IIS7 +添加它

You will also need to add this for IIS7+

<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->
     </requestFiltering>
    </security>   
</system.webServer>

这篇关于在asp.net MVC中上传大文件时,出现HTTP错误404.13-未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆