What do you think about extending Multer with a few new options?
See original GitHub issueWhat do you think about extending Multer with a few new options such as minCount
and count
as an addition to existing maxCount
?
Honestly speaking, I need these options. For now, I can check only maxCount
. If my application needs to get at least three pictures from a client, I cannot check this with Multer. For now, Joi handles it. I don’t like to separate these validations mechanism. Validating at least the basic things with Multer would be great.
Also, we can add fileType
option. We can use this library to check the files’ types. I understand that this is possible to do with the Multer’s fileFilter
function. But I think it would be great to have this filter. It will help the new users to enter into Multer faster. They will have a few useful options out of the box.
@LinusU, I will be happy to hear your thoughts.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
I’m going to go ahead and close this issue per @LinusU comment. Implementing further checks around the number of files being uploaded is currently out of scope for multer.
Hi, i also think that the
minCount
option would be very useful. i have a case, where I upload multiple files via.fields([...array])
I wanted to check if those files exist, before sending it to s3 via
multer-s3
Was looking for something like
{ name: 'avatar', maxCount: 1, minCount: 1 }
or{ name: 'avatar', maxCount: 1, required: true }
and landed on this issue 😄