Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unabled to delete tempFiles while using limitHandler #295

Open
Xenope opened this issue Nov 15, 2021 · 0 comments
Open

Unabled to delete tempFiles while using limitHandler #295

Xenope opened this issue Nov 15, 2021 · 0 comments

Comments

@Xenope
Copy link

Xenope commented Nov 15, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant