I want upload more than default ~30MB file on my website app
HTTP Error 404.13 - Not Found The request filtering module is configured to deny a request that exceeds the request content length.
Most likely causes: Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value.
I google it and i set up Program.cs like this:
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options => { options.Limits.MaxRequestBodySize = null; })
.Build();
and Startup.cs like this:
app.Run(async (context) =>
{
context.Features.Get<IHttpMaxRequestBodySizeFeature>()
.MaxRequestBodySize = null;
});
i tried also set up attribute on my class for uploading file like this:
[HttpPost]
[DisableRequestSizeLimit]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(CreateFileViewModel model)
but i still have same problem. I cant understand. Thank you for any advice.