richardgirges / express-fileupload

Simple express file upload middleware that wraps around busboy
MIT License
1.52k stars 261 forks source link

Add `numFilesLimitHandler` option so user can provide handler for busboy's `filesLimit` event #253

Open jseppi opened 3 years ago

jseppi commented 3 years ago

This is a re-attempt at https://github.com/richardgirges/express-fileupload/pull/152.

It adds a new configuration option, numFilesLimitHandler, so that the consumer can provide a handler function when busboy's 'filesLimit' event is triggered. This event is triggered when the number of files uploaded surpasses the specific limits.files.

jseppi commented 3 years ago

Seems like an unrelated test is failing: https://travis-ci.com/github/richardgirges/express-fileupload/jobs/411601698#L315

It is also failing in this other PR https://github.com/richardgirges/express-fileupload/pull/244/commits that only fixes a typo: https://travis-ci.com/github/richardgirges/express-fileupload/jobs/379107787#L320

jseppi commented 3 years ago

Ah, the test is failing in master as well:

image

https://travis-ci.com/github/richardgirges/express-fileupload

gweiying commented 2 years ago

Is there any plan to pick up this PR where it was left off?

My current workaround (middleware to check the array length and throw an error) feels clunky, would be down to help with this issue.