tus-node-server icon indicating copy to clipboard operation
tus-node-server copied to clipboard

Add EVENT_CHUNK_UPLOADED event

Open Ivan-Feofanov opened this issue 8 years ago • 6 comments

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

Ivan-Feofanov avatar Jan 11 '17 14:01 Ivan-Feofanov

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!

bhstahl avatar Dec 02 '17 16:12 bhstahl

Thanks for rebasing @Ivan-Feofanov, it looks like this build failure is something to fix.

bhstahl avatar Dec 05 '17 11:12 bhstahl

i need this too.

Lyoko-Jeremie avatar Nov 07 '19 10:11 Lyoko-Jeremie

@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.

Acconut avatar Nov 07 '19 10:11 Acconut

Hi, @Acconut , i has been tested this PR, but it not work well.
Please check the details on there : #158

Lyoko-Jeremie avatar Nov 11 '19 10:11 Lyoko-Jeremie

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,
 };

luxigo avatar May 09 '20 10:05 luxigo

Thanks for the PR. This will be superseded by #336

Murderlon avatar Nov 18 '22 18:11 Murderlon