Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ASP.NET MVC 5.1/IIS中,当上载请求大小大于4 MB时,请求从不返回?_Asp.net_Asp.net Mvc_Iis_Iis 7.5_Asp.net Mvc 5.1 - Fatal编程技术网

在ASP.NET MVC 5.1/IIS中,当上载请求大小大于4 MB时,请求从不返回?

在ASP.NET MVC 5.1/IIS中,当上载请求大小大于4 MB时,请求从不返回?,asp.net,asp.net-mvc,iis,iis-7.5,asp.net-mvc-5.1,Asp.net,Asp.net Mvc,Iis,Iis 7.5,Asp.net Mvc 5.1,我在Windows 7上创建了一个非常简单的ASP.NET MVC 5.1应用程序,其中包含IIS。我有一个非常简单的表单和控制器。我知道ASP.NET中的默认请求限制是4MB。但是当我上传大于4MB的文件时。我的请求永远不会回来。在Chrome、Firefox和IE上测试。实际上,我的控制器断点从未达到。我认为ASP.NET MVC async内部有问题。这是我的html表单 @using (Html.BeginForm("Add", "Product", FormMethod.Post, n

我在Windows 7上创建了一个非常简单的ASP.NET MVC 5.1应用程序,其中包含IIS。我有一个非常简单的表单和控制器。我知道ASP.NET中的默认请求限制是4MB。但是当我上传大于4MB的文件时。我的请求永远不会回来。在Chrome、Firefox和IE上测试。实际上,我的控制器断点从未达到。我认为ASP.NET MVC async内部有问题。这是我的html表单

@using (Html.BeginForm("Add", "Product", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
       <input type="file" id="files" name="files" placeholder="Title" accept="image/x-png, image/gif, image/jpeg" />
}

public async Task<ActionResult> Add(IEnumerable<HttpPostedFileBase> files)
{
更新:在Chrome上,我不断看到这一点。 您需要在web配置上设置maxAllowedContentLength

像这样:

<system.webServer>
    <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="900000000" />
          </requestFiltering>
     </security>
</system.webServer>