简体   繁体   中英

Uploading Large File in C# & ASP.NET MVC

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM