Limit formdata file size #300
-
How can I limit file upload size? |
Beta Was this translation helpful? Give feedback.
Answered by
kartikk221
Sep 24, 2024
Replies: 1 comment 3 replies
-
Hello, there are multiple ways to approach this:
Overall, I would recommend handling this at the Server/Route level since then HyperExpress will gracefully flush any incoming additional data and handle closing of the request for you for oversized requests. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
kartikk221
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, there are multiple ways to approach this:
max_body_length
when creating theHyperExpress.Server
instance to restrict global Request body size.max_body_length
when creating the route with options to restrict that specific route's body size.BusboyConfig.limits
options when callingRequest.multipart(config)
to specify a custom limiter within the multipart parser itself.Overall, I would recommend handling this at the Server/Route level since then HyperExpress will gracefully flush any incoming additional data and handle closing of the request for you for oversized requests.