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
7.06k stars 682 forks source link

Is it possible to get progress event only if there are file fields in the form? #487

Closed n-samir closed 4 years ago

n-samir commented 6 years ago

var formidb = new formidable.IncomingForm(); formidb.on('progress', function(bytesAlreadyIn, bytesExpected) {..

I want to do something like: if (form-has-file-fields) formidb.on('progress', function(..) {..

xarguments commented 5 years ago

Right now there is no flag that does it.

Yet you can use listen to the filebegin event and set a boolean flag to true in order to detect files (while the upload is in progress)

Waiting for your response to see if it helped.