Answer the question
In order to leave comments, you need to log in
How to set a limit on the uploaded file (different limits for different routes)?
Sobsna, the question is in the title, I use the express-fileupload, body-parser packages.
I tried to set it like this, in general for all routes:
Answer the question
In order to leave comments, you need to log in
body-parser does not control file uploads (multipart), so the restriction will affect only data
express-fileupload uses the busboy parser, the limits for which actually limit file recognition to the size you specified. Those. will be loaded, but will not be parsed.
To limit the loading of the POST body, use nginx as a limiter, and nodejs as a handler only.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question