clomas
clomas

Reputation: 103

ASP.NET MVC : maximum request length exceeded despite maxRequestLength maxAllowedContentLength set in web.config

I've been trying to upload a file larger than 4mb to an ASP.NET MVC web application (for a long time) and I've looked at so many stack exchange articles so I am aware this is a duplicate, but I've tried everything I'm not making any progress.

I'm running Visual Studio 2019 16.3.9 / IISExpress 10.0 / .NET 4.5.2.

The following code has been added

<location path="UploadedAudio">
  <system.web>
    <httpRuntime executionTimeout="3600" maxRequestLength="1048576" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
    </security>
  </system.webServer>
</location>

Things I've tried to resolve the issue:

But nothing seems to work for me. Are there any considerations for running in debug mode in Visual Studio that I'm missing?

Any help would or corrections would be greatly appreciated!

Upvotes: 0

Views: 1338

Answers (1)

clomas
clomas

Reputation: 103

I had to copy this - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\web.config

edit it with the maxRequestLength and maxAllowedContentLength

then copy the file back into the directory.

Upvotes: 0

Related Questions