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)
-
0
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>
-
0
@aaron Thank you for your reply. But we are talking about ABP Service not normal WebApi Service
-
0
I didn't mention WebApi. Please see the link for Generic Middleware Instructions and Global Config Instructions.