node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

maxFileSize not working as it should #971

Open MohamedKarrab opened 3 months ago

MohamedKarrab commented 3 months ago

Support plan

Context

What are you trying to achieve or the steps to reproduce?

I think the maxFileSize check only happens after the file is fully uploaded, how to make it so it's immediate after bytes received exceed the set limit?

What was the result you got?

Only after file fully uploaded

What result did you expect?

Immediately after limit is reached

tunnckoCore commented 3 months ago

@MohamedKarrab I think the maxFileSize check only happens after the file is fully uploaded

I think so too. But I thinko you can work around that by using onPart