Skip to content

Item Chunk Count and chunk index in CHUNK_EVENTS.CHUNK_START not coming Properly #189

Answered by yoavniran
vinodkhandelwal asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @vinodkhandelwal

For the chunk index, This should get you the correct info:

  uploader.on(CHUNK_EVENTS.CHUNK_START, ({ chunk }) => {
     const { index } = chunk;

         const chunkNumber = index + 1; //index is 0 based
       //...
  });

As for the total count. You are right, the chunkCount is updated down as chunks are being sent. I will need to think about this to at least rename (ex: remainingCount), to make sure its much clearer.

I will also add a new prop that will hold the total count without updating it so it can be used as you need it.

For now, Im afraid there is no pretty solution until I make the changes. The best thing is probably storing the total when the first chunk i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yoavniran
Comment options

@vinodkhandelwal
Comment options

Answer selected by vinodkhandelwal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants