How to track progress of file uploading via saveIFPS

So, I am able to upload file over IFPS, but I want to make a progress bar of it. How may I?

1 Like

you could approximate how much it takes based on file size

I was expecting something more precise like:

addEventListener('progress', event => { })

onprogress = event => { }

Could someone point out where to start to go with @cryptokid’s suggested approach please?

I was thinking that you could know that a 20MB file would take maybe 10 seconds and do some kind of approximation starting with something like this, but it will not be precise.

well there is a way to do this, you will get the size of the image and if it is 4mb you will set the reach destination to 4mb and then when it start uploading it will start from 0 and increment to 4mb and you can use something like that

const added = await client.add(file, {
        progress: (prog) => console.log(`received: ${prog}`),

this should console log the receive bytes

1 Like