Files
n8n/patches/multer@2.5.0.patch
n8n-cat-bot[bot] 731c17c61e fix: Update Multer to 2.5.0 and preserve upload cleanup (#43157)
Co-authored-by: n8n-cat-bot[bot] <283985454+n8n-cat-bot[bot]@users.noreply.github.com>
2026-11-09 11:39:28 +00:00

16 lines
814 B
Diff

diff --git a/lib/make-middleware.js b/lib/make-middleware.js
--- a/lib/make-middleware.js
+++ b/lib/make-middleware.js
@@ -396,8 +396,7 @@ function makeMiddleware (setup) {
if (aborting) {
appender.removePlaceholder(placeholder)
- // On error the engine stored nothing and the file has no path, so
- // there is nothing to clean up; only record a successfully stored
- // file for the abort cleanup list.
- if (!err) uploadedFiles.push({ ...file, ...info })
+ // A failed disk write can leave a partial file. Keep it in the
+ // abort cleanup list when the storage engine assigned a path.
+ if (!err || file.path) uploadedFiles.push({ ...file, ...info })
return decrementPendingWrites()
}