0

I am trying to upload a file using C# and ASP.NET MVC, and I am getting this error:

HTTP Error 413.1 - Request Entity Too Large
The request filtering module is configured to deny a request that exceeds the request content length.

This is how I configure my web.config:

<system.web>
    <authentication mode="None"/>
    <compilation debug="true" targetFramework="4.7.2"/>
    <httpRuntime targetFramework="4.7.2"  executionTimeout="3600" maxRequestLength="104857600" enable="true"/>
</system.web>
1

1 Answer 1

1

For IIS7 and above, you also need to add the lines below:
 <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
   </security>
 </system.webServer>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.