How can we know the size of the file uploded in busboy? I want to know the exact size of the file
That's up to you to keep track of. busboy just provides the file streams.
It looks like lib/types/multipart.js calculates the file size already to check fileSizeLimit. Would you guys consider implementing/accepting a PR for that size to be emitted as a property on the FileInfo that already gets returned for bb.on('file'...)?
@gazebosx3 That’s not possible in general. fileSizeLimit is checked as the stream for the file is read, i.e. after the file event is emitted.
@gazebosx3 As @charmander said, that's not possible. You will need to count the bytes yourself as the file streams in if you need the total size when the stream ends.