By default, ASP.NET Core allows you to upload files up of (approximately) 28 MB in size. However, for an application I had to update this limit to support files up to 128MB.
Let’s see what should be done to get this working in ASP.NET Core:
Open your Startup.cs and write the following code in the ConfigureServices():
The code above configures the FormOptions and sets the MultipartBodyLengthLimit property to 128MB.
Unfortunately we are not done yet. Depending on if you use Kestrel or host your application in IIS (Express), some extra work is required.
IIS (Express)
For IIS (Express) you need to update your web.config and add the following configuration section:
Kestrel
For Kestrel, you need to add some extra code in your Program.cs file: