Base solution for your next web application
Open Closed

ABP Application service Maximum Message Size #3940


User avatar
0
amrsaafan created

Hello,

How and where to set the maximum message size for an application service? My service fails when a large file is being sent over to the service, so I need to increase the maximum size of bytes the service can receive.


3 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    If you want to change the max request body size limit for a specific MVC action or controller, you can use the RequestSizeLimit attribute. The following would allow MyAction to accept request bodies up to 100,000,000 bytes.

    [HttpPost]
    [RequestSizeLimit(100_000_000)]
    public IActionResult MyAction([FromBody] MyViewModel data)
    {
    

    [DisableRequestSizeLimit] can be used to make request size unlimited. This effectively restores pre-2.0.0 behavior for just the attributed action or controller.

    See: <a class="postlink" href="https://github.com/aspnet/Announcements/issues/267">https://github.com/aspnet/Announcements/issues/267</a>

  • User Avatar
    0
    amrsaafan created

    @aaron Thank you for your reply. But we are talking about ABP Service not normal WebApi Service

  • User Avatar
    0
    aaron created
    Support Team

    I didn't mention WebApi. Please see the link for Generic Middleware Instructions and Global Config Instructions.