()
| 655 | } |
| 656 | |
| 657 | _setUpMaxFiles() { |
| 658 | if (this.options.maxFiles !== Infinity) { |
| 659 | let fileCount = 0; |
| 660 | this.on('fileBegin', () => { |
| 661 | fileCount += 1; |
| 662 | if (fileCount > this.options.maxFiles) { |
| 663 | this._error( |
| 664 | new FormidableError( |
| 665 | `options.maxFiles (${this.options.maxFiles}) exceeded`, |
| 666 | errors.maxFilesExceeded, |
| 667 | 413, |
| 668 | ), |
| 669 | ); |
| 670 | } |
| 671 | }); |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | _maybeEnd() { |
| 676 | if (!this.ended || this._flushing || this.error) { |