-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Partially uploaded files are not removed when fileSize kicks in #194
Comments
I think I might have squashed that bug last night, or maybe not... Which version of multer are you using? |
Hey Linus, thank you for your feedback; I've just updated to 1.0.3, and now the file is deleted in case it exceeds the However: The solution which you were describing in #186 for custom error handling does not work any longer with 1.0.3:
As I was also relying on the custom error handling: Any solution on getting that fixed? |
I am having the same issue as @qqilihq where the err.code is not being set to 'LIMIT_FILE_SIZE' when the limit file size is exceeded in 1.0.3. A workaround is to perform the following check
|
@PokerCurve Thank you for the suggestion, however in that case I cannot distinguish between the cases where (1) the limit was exceeded or (2) no file was attached at all. And I would really like to do that for better error messaging. |
This should absolutely work, I'm sorry to have broke it. This is very related to nodejs/node#2323 which there is a proposed fix for. Unfortunately I'm on vacation on a remote island with very bad internet connection and limited time to devote to this. Sorry, I just found this message sitting in the textbox, I forgot to hit "comment" 😕 |
Hi Linus, I've fixed the issue and sent you a pull request. Enjoy your vacation. |
@LinusU Yes, I can confirm that it solves the issue in my case. |
This should be fixed by #205 and released on npm as version Please reopen if issue persists. |
Hi, |
I'm using the
fileSize
property to set a maximum upload size limit. In case, the uploaded file size exceeds the specifiedfileSize
limit, the transfer is interrupted (as expected), but the partially uploaded file still exists on disk.I feel, that such files should be removed automatically (also concerning the fact, that there seems to be no way of retrieving the path of partially uploaded files within my callback methods).
The text was updated successfully, but these errors were encountered: