react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

How to get the upload progress for each file during multiple image uploading?

Open SalihZinaty opened this issue 5 years ago • 3 comments

I'm mapping through images and uploading them from a Realm DB. when uploading two images, the images upload progress sync to each other instead of running separately.

Upload.getFileInfo(finalPath).then(metadata => { //console.log('image name of file', image.file_name) Upload.startUpload(options) .then(uploadId => { console.log( Upload started with options: ${JSON.stringify(options)}, ); { Upload.addListener('progress', uploadId, data => { console.log(Progress of ${uploadId}: ${data.progress}%); realm.write(() => { image.upload_progress = data.progress / 100; }); }); })} what can I do to make every image take it's own progress? thanks!

SalihZinaty avatar Aug 04 '20 08:08 SalihZinaty

the uploadId should be there to differentiate between uploads

reime005 avatar Aug 04 '20 10:08 reime005

the uploadId should be there to differentiate between uploads

Can you tell me where to put it? Because the progress listener is inside the then of uploadId Thanks!

SalihZinaty avatar Aug 04 '20 10:08 SalihZinaty

can you provide a bigger/formatted example?

reime005 avatar Aug 04 '20 13:08 reime005