expressjs / multer

Node.js middleware for handling `multipart/form-data`.
MIT License
11.57k stars 1.06k forks source link

File delete issue #1217

Open itsfuad opened 1 year ago

itsfuad commented 1 year ago

When user is uploading a file, multer stores it on the disk. But if user aborts the upload, the "abort" event is caught but the file cannot be deleted until server is closed.

FurqanAnwar commented 1 year ago

@itsfuad Can you elaborate this issue. How does user aborts the upload by manually cancling the process?

Doc999tor commented 1 year ago

@itsfuad It's an old bug in multer - https://github.com/expressjs/multer/issues/259 In the conversation you can find a number of workarounds - basically you can listen to req 'aborted' event But it still creates unclosed stream and stuck file handler