Skip to content

Commit d285a08

Browse files
fix: Use fileBegin hook to properly fail when maxFiles is exceeded (#881)
fix: Use fileBegin hook to properly fail maxFiles
1 parent 81dd350 commit d285a08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Formidable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class IncomingForm extends EventEmitter {
599599
_setUpMaxFiles() {
600600
if (this.options.maxFiles !== Infinity) {
601601
let fileCount = 0;
602-
this.on('file', () => {
602+
this.on('fileBegin', () => {
603603
fileCount += 1;
604604
if (fileCount > this.options.maxFiles) {
605605
this._error(

0 commit comments

Comments
 (0)