diff --git a/lib/processMultipart.js b/lib/processMultipart.js index 1ea7590..eb4993c 100644 --- a/lib/processMultipart.js +++ b/lib/processMultipart.js @@ -96,6 +96,8 @@ module.exports = (options, req, res, next) => { ? tempFileHandler(options, field, filename) // Upload into temporary file. : memHandler(options, field, filename); // Upload into RAM. + cleanups.push(cleanup); + const writePromise = options.useTempFiles ? getWritePromise().catch(err => { req.unpipe(busboy); diff --git a/package-lock.json b/package-lock.json index f1a4e2b..94ed279 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fatchan/express-fileupload", - "version": "1.4.1", + "version": "1.4.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@fatchan/express-fileupload", - "version": "1.4.1", + "version": "1.4.2", "license": "MIT", "dependencies": { "busboy": "^1.6.0" diff --git a/package.json b/package.json index d4617d5..a88ad45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fatchan/express-fileupload", - "version": "1.4.1", + "version": "1.4.2", "author": "Richard Girges ", "description": "Simple express file upload middleware that wraps around Busboy", "main": "./lib/index",