We are using the tempFolder and dealing with the file size limit with the limitHandler.
We are doing some logging and then rejecting the error :
res.status(413); res.json(error);
but it's impossible to delete (fs.unlink()) the file currently in the temp folder.
The code that cleans up the temporaryFolder (cleanUp()) is never called, moreover the file is still open because the writeStream.end(); of the cleanUp() method is never called making it unabled to delete it on windows until the node process is over.
One simple solution would be to pass the cleanUp() method as a fourth argument to the limitHandler() method.
Anybody have experienced this issue or have an other workaround?
PS: On linux the file is deleted event tough the writeStream.end(); has not been called.
We are using the tempFolder and dealing with the file size limit with the limitHandler.
We are doing some logging and then rejecting the error :
res.status(413); res.json(error);
but it's impossible to delete (
fs.unlink()
) the file currently in the temp folder.The code that cleans up the temporaryFolder (
cleanUp()
) is never called, moreover the file is still open because thewriteStream.end();
of thecleanUp()
method is never called making it unabled to delete it on windows until the node process is over.One simple solution would be to pass the
cleanUp()
method as a fourth argument to thelimitHandler()
method.Anybody have experienced this issue or have an other workaround?
PS: On linux the file is deleted event tough the
writeStream.end();
has not been called.