Closed maroallegro closed 7 years ago
In 2.0.0 Kestrel enforces a maximum request size for security. This is in addition to the limits on form-data which we had in 1.1.0.
You can configure this globally - https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Kestrel.Core/KestrelServerLimits.cs#L152 Or on a specific action - https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/RequestSizeLimitAttribute.cs
/cc @halter73 @Tratcher - does this need an announcement? I looked for one and could not find it.
This issue was moved to aspnet/KestrelHttpServer#1982
WebApi created in .NetCore 2.0 by default references AspNetCore 2.0:
When we will not use IIS, but make startup project which starts WebApi:
it is impossible to send 60 MB file, because WebApi throws 413 Payload Too Large error.
Situation occurs despite of: -changing
maxAllowedContentLength
inweb.config
to bigger value -changing FormOptions in Startup.cs file-moving web.config files to root folders
Problem do not occur in .NETCore 1.1 WebApi because they references to AspNetCore 1.1:
To solve the problem in .NetCore 2.0 WebApi we can change:
to:
Please see projects below which shows the problem. When running specific WebApi set Starter project as Startup project.
FileTransferTestApp.zip