0

I have created a very simple ASP.NET MVC 5.1 app with IIS on Windows 7. I have a very simple form and controller. I know the default request limit in ASP.NET is 4MB. But when I upload file(s) greater than 4 MB. My request will never ever return. Tested on Chrome, Firefox and IE. Actually my controller break-point never hit. I think something wrong inside ASP.NET MVC async. Here is my html form,

@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)
{

Update: On Chrome I am seeing this continuously. enter image description here

Imran Qadir Baksh - Baloch
  • 32,612
  • 68
  • 179
  • 322

1 Answers1

0

You need to set maxAllowedContentLength on your web config.

like this:

<system.webServer>
    <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="900000000" />
          </requestFiltering>
     </security>
</system.webServer>
natnael88
  • 1,128
  • 10
  • 22