How to increase upload file size in ASP.NET Core

[HttpPost]
[RequestSizeLimit(100_000_000)]
public IActionResult MyAction([FromBody] MyViewModel data)
{
[HttpPost]
[DisableRequestSizeLimit,
RequestFormLimits(MultipartBodyLengthLimit = int.MaxValue,
ValueLengthLimit = int.MaxValue)]
public async Task<ActionResult> BulkAdd(string schema, IFormFile file)
{

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicola Iarocci

Nicola Iarocci

Software Craftsman. Everything I post on Medium is a copy — the originals are on my own website, nicolaiarocci.com