0

I tried the below code by changing upload limit of 100 MB and tried uploading 50 MB file and still get error 413 Payload too large and after that i tried to follow steps of adding attribute to the controller but didn't work. Can you please let me know how i can achieve it.

Webconfig:

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

Code:

[HttpPost]
 [Route("")]
 [ProducesResponseType(typeof(ResponseModel), 200)]
 [ValidateHeaders]
 [RequestSizeLimit(100288000)]
 public async Task<IActionResult> Submit([FromBody] Formdata formdata)
 {

}
1
  • ASP.NET Core doesn't use web.config at all. If the web app runs under IIS web.config affects IIS but doesn't change ASP.NET Core's limits Commented Dec 17, 2024 at 17:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.