Open Closed

File Management Module -> Files failing to upload above 28MB #1344


User avatar
0
jtallon created
  • ABP Framework version: v4.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular) : no
  • Issue: How can I increase the Request Size for just the FileManagement Upload Module?
  • Steps to reproduce the issue:

[12:39:03 WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Your request is not valid!", "details": "The following errors were detected during validation.\r\n - Failed to read the request form. Request body too large.\r\n", "data": {}, "validationErrors": [ { "message": "Failed to read the request form. Request body too large.", "members": [ "" ] } ] }


1 Answer(s)
  • User Avatar
    0
    jtallon created

    I have resolved this aready myself.. please set as closed.

    Added some middleware directives to the Startu.cs.

    webBuilder.UseKestrel(options => { options.Limits.MaxRequestBodySize = long.MaxValue; });

    Also in the main web module I added

    services.Configure<FormOptions>(x => { x.ValueLengthLimit = int.MaxValue; x.MultipartBodyLengthLimit = int.MaxValue; // if don't set default value is: 128 MB x.MultipartHeadersLengthLimit = int.MaxValue; });

    All of these are inline with the aspnet core docs, althought we wont be leaving the MaxValues in there.

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