Closed hossein-zare closed 2 years ago
Why?
I'm using multer which is written on top of this package.
Users have their own storage data like maxFileSize
and it's not hard-coded and the same for everyone.
Example:
Bill's maxFileSize
is 1,048,576 Bytes and Alice's is 3,145,728 Bytes.
const upload = multer({
storage,
limits: {
fileSize: (req) => {
return req.storage.maxFileSize;
},
},
});
Seems like that feature makes more sense for multer’s API (declarative middleware) than busboy’s (single-use object constructed based on the request).
I agree, I don't think busboy
is the right place to implement this sort of feature. What you're asking for should be able to be trivially implemented by just setting limits
dynamically (when calling multer()
) based on data hanging off of req
.
Alright, I hope multer
won't send me back to busboy
😁