Operating Environment
Asp .Net Core 5.0
Error Log
Failed to read the request form. Request body too large.
Solution:
Modify Startup.cs
file
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.Configure<FormOptions>(x =>
{
x.MultipartBodyLengthLimit = 1024 * 1024 * 1024;
x.ValueLengthLimit = int.MaxValue;
});
services.Configure<KestrelServerOptions>(options =>
{
options.Limits.MaxRequestBodySize = 1024 * 1024 * 1024;
});
}
Similar Posts:
- .Net Core 5.0 Upload File sizes is limited via Swagger Api: error: request entity too large
- An error is reported when swagger is used: failed to load API definition
- [Solved] interceptor Cross-Domain Access-Control-Allow-Origin Error
- C# WinForm: How to Generate two bit random number
- How to Solve Error: Preflight response is not successful
- PXE install windows System Error: pxe-e55:ProxyDhcp service did not reply to request on port 4011
- Windows service install and startup error 1053: the service did not respond to the startup or control request in time (example code)
- [Solved] Linux Start solr Error: Your Max Processes Limit is currently 31202. It should be set to 65000 to avoid operational disruption.
- /lib64/libc.so.6: version `GLIBC_2.14′ not found [How to Solve]
- Flink Project Start Error: java.lang.OutOfMemoryError: unable to create new native thread [How to Solve]