tus-node-server
tus-node-server copied to clipboard
Add EVENT_CHUNK_UPLOADED event
I needed to monitor the upload progress on the server side, and I added an event EVENT_CHUNK_UPLOADED with payload:
{
file: file config from options,
loaded: {
bytes: bytes already loaded,
chunks: chunks already loaded,
},
total: {
bytes: file size in bytes,
chunks: file size in chunks,
}
}
I think it will be useful to others
Hey @Ivan-Feofanov, I fixed the issue causing travis branch builds to fail. If you want to rebase in those changes, I'd be happy to try adding this event. Thanks for your contribution!
Thanks for rebasing @Ivan-Feofanov, it looks like this build failure is something to fix.
i need this too.
@Lyoko-Jeremie Feel free to pick up this PR and freshen it up. We are happy to merge such a PR but don't have the resources to do it on our own.
Hi, @Acconut , i has been tested this PR, but it not work well.
Please check the details on there : #158
Hi, @Acconut , i has been tested this PR, but it not work well. Please check the details on there : #158
What's not working very well in this PR ? I cannot figure it out in your link, it seems unrelated.
At least EVENTS.EVENT_CHUNK_UPLOADED should be defined I guess
--- a/lib/constants.js
+++ b/lib/constants.js
const EVENTS = {
EVENT_ENDPOINT_CREATED,
EVENT_FILE_CREATED,
+ EVENT_CHUNK_UPLOADED,
EVENT_UPLOAD_COMPLETE,
};
Thanks for the PR. This will be superseded by #336