I am using dropzonejs with MVC Core 3.1 and Kestrel and try to Upload the 200+ MB file but the posted file is always null
Here is my dropzone configus
var myDropzone = new Dropzone(document.body, {
url: '@Url.Action("HandleUpload", "Files", new { Id= "Test0001" })',
paramName: "file",
parallelUploads: 1,
maxFilesize: 512,
timeout: 1800000,
thumbnailWidth: 80,
thumbnailHeight: 80,
previewTemplate: previewTemplate,
acceptedFiles: 'image/jpeg,image/x-citrix-jpeg,image/png,image/x-citrix-png,image/x-png,video/mp4,video/quicktime,video/x-ms-wmv,video/x-flv',
autoQueue: false,
previewsContainer: "#previews",
clickable: ".fileinput-button",
dictRemoveFileConfirmation: "Are you sure to remove this file ?"
});
this is my Controller
[HttpPost]
public async Task<ActionResult> HandleUpload(IFormFile file, string id)
{
//file and id is null with 237MB file
var jwt = new JwtSecurityToken("AccessToken");
var sub = jwt.Subject;
}
and Program.cs
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseWindowsService()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureKestrel(kestrelOptions =>
{
kestrelOptions.Limits.MaxRequestBodySize = 545259520; //520 MB
kestrelOptions.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(10);
kestrelOptions.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(10);
kestrelOptions.Limits.MaxConcurrentConnections = 1000;
kestrelOptions.Listen(ipAddress, 443, listenOptions =>
{
listenOptions.UseHttps();
});
});
webBuilder.UseStartup<Startup>();
});
when i upload the .mp4 file with less than 5 MB it works fine but the .mp4 with 237 MB my 'file' and 'id' in the Controller is null and there is no errors occured.
How to solve this problem ?