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

Remove empty files #241

Merged
merged 5 commits into from
Aug 14, 2020
Merged

Conversation

nusu
Copy link
Contributor

@nusu nusu commented Aug 7, 2020

Follow up PR for #233

#233 seemed to exclude empty files from req.files but for temporary files, it still creates a writestream right after busboy triggers the .on("file") method, I did some research in hopes to find a flag for fs.createWriteStream to actually check and remove if the file is empty on the end but there's no such a thing.

And we are not able to not create a stream while we can't get the size info until the end, so the best thing we can do is follow the condition we have on file.on('end') and cleanup if temporaryFiles is enabled.

@nusu nusu mentioned this pull request Aug 7, 2020
@nusu
Copy link
Contributor Author

nusu commented Aug 13, 2020

@richardgirges can we merge this?

@richardgirges
Copy link
Owner

Looks good! Thanks for the PR. Merging now.

@richardgirges richardgirges merged commit 6458793 into richardgirges:master Aug 14, 2020
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

Successfully merging this pull request may close these issues.

3 participants