Reputation: 79
I am trying upload very large files, about 15-20 GB using Asp.net core via Postman. I have adjusted the maxRequestLength as well as maxAllowedContentLength, as suggested in other posts, but since the max limits for these parameters is about 2GB, I still keep getting the 'The request filtering module is configured to deny a request that exceeds the request content length.' error. How can I upload files of this size?
Upvotes: 1
Views: 3883
Reputation: 713
Nope you can't do that in this time with .NET Core because Microsoft has noticed the limitation of file size (not over 2Gb). Link here: https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-3.1
Limitations in the ASP.NET Core Module or presence of the IIS Request Filtering Module may limit uploads to either 2 or 4 GB. For more information, see Unable to upload file greater than 2GB in size (dotnet/AspNetCore #2711).
And the issue has been logged but can't be resolved link
IMO, if you want to build a storage service with .NET Core, you need to force user to split this large file into several chunk files (such as using zip.001, zip.002 etc.) then you trigger any cli to merge these chunk files (ex: unzip
on Linux)
Upvotes: 0
Reputation: 137
I presume that you host your web application on IIS. So on IIS level you have a filter, which does not allow you to upload large files like that. You can unlock this filter directly in IIS. Also you will need to configure Kestrel if you are using it. More information can be found here. https://www.webdavsystem.com/server/documentation/large_files_iis_asp_net/
Upvotes: 1