user2432361
user2432361

Reputation: 185

Cannot Upload image of 50 MB in Asp.net Core 6

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

}

Upvotes: 0

Views: 21

Answers (0)

Related Questions