Use onShardStored option in uploadFile and uploadDirectory.
See how it gets used in the w3cli here:
https://github.com/web3-storage/w3cli/blob/55f546be85e321b00ddd18c8ded277935eedebde/index.js#L129C5-L129C18
See how the progress percentage UI was implemented previously in web3storage script:
Files:
|
onStoredChunk: getProgressUpdater(files), |
Folder:
|
onStoredChunk: getProgressUpdater(updatedFiles), |

Use
onShardStoredoption inuploadFileanduploadDirectory.See how it gets used in the w3cli here:
https://github.com/web3-storage/w3cli/blob/55f546be85e321b00ddd18c8ded277935eedebde/index.js#L129C5-L129C18
See how the progress percentage UI was implemented previously in web3storage script:
Files:
dscan/src/scripts/web3Storage.js
Line 20 in b01101a
Folder:
dscan/src/scripts/web3Storage.js
Line 50 in b01101a