-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Invalid calculation of file size when uploading multiple files under the same stream/name #4838
Comments
Thanks for posting, @vbogdanov. I'm a repo bot-- nice to meet you! It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help! |
@vbogdanov Hmm, yeah we're just tallying up bytes as chunks arrive (I don't think there's a way we can figure out the remaining length of the stream-- that'd be easier. But something funny does indeed seem to be going on. Would you mind posting your versions of Skipper/Express/Node/NPM for reference? |
Reproducible with |
@vbogdanov any progress on this? |
I'm experiencing the same issue when uploading multiple files under the same key. On the client I use; fileBlob1 size is 10000 bytes
backend:
The first file size is the aggregate size of all files but every file after that is correct. node v4.4.0 |
This issue is related to the dependency node-multiparty (https://github.com/andrewrk/node-multiparty) and a similar issue pillarjs/multiparty#70. This issue has to do with the I'll continue to investigate a solution.. |
A consistent workaround to get the correct file size:
|
@crobinson42 thanks for the workaround! Obviously that won't work with other adapters, but it'll help a lot of folks out in the mean time. @sgress454 or I will take a closer look at this as soon as we can. |
@vbogdanov @NAlexandrov @crobinson42 This is now fixed (to the best of our knowledge) in the latest skipper-disk and skipper-s3 on NPM (cc @sgress454) |
HTML:
Express Route:
Uploading 3 files, sizes 5844, 197, 710494 bytes, expected sizes in files - 5844, 197, 710494
actual:
After a short look at the code my best guess is that the remaining length of the stream is used as file size. This is correct for single files but fails for multiple files as the size of the first equals the size of all files plus the size of the metadata in between. (Again, this is just a guess)
The text was updated successfully, but these errors were encountered: