Open Closed

Upload Large Files Using FileManagement Module Getting 413 Error #2995


User avatar
0
shijo created
  • ABP Framework version: v5.2.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: ERR_FAILED 413
  • Steps to reproduce the issue:" Upload a large file, we are using a 200MB file. getting error.


2 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    This error seems to be based on the server you are hosting. Even if you solve the problem in your localhost, you'll need to configure maxAllowedContentLength on the server you are hosting the application.

    You can configure the Kestrel in Program.cs like:

        var builder = WebApplication.CreateBuilder(args);
        builder.WebHost.ConfigureKestrel(opt => opt.Limits.MaxRequestBodySize = long.MaxValue); // Add this line
        builder.Host
            .AddAppSettingsSecretsJson()
            .UseAutofac()
            .UseSerilog();
        await builder.AddApplicationAsync<BServerBlazorModule>();
        var app = builder.Build();
    

    Also if you are running on IIS, update Web.config with:

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="2147483647" />
        </system.web>
    </configuration>
    

    Entered numbers are in bytes, configure as you desire.

    You can also check HTTP Error 413.1 - Request Entity Too Large - How to fix.

  • User Avatar
    0
    shijo created

    with Kestrel hosting it is working, I was facing this issue with IIS Express, I found the solution for IISExpress now it is working.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09