How to show file download progress?


#1

Hello team, I want to show download percentage by using https://ionicframework.com/docs/native/file-transfer/
but I have no idea to do it , I need you help

from:
IONIC Newbie :smiley:


Noone replies my question :)
#2

const fileTransfer: FileTransferObject = this.transfer.create();

fileTransfer.onProgress((data) => {
setInterval(() => {
this.totalSize = data.total;
if (data.loaded >= this.totalSize) {
this.totalSize = data.total;
this.onDownload = true;
}
},2000)
console.log("check data onprogress ", data.total);
console.log("check data onprogress ", data.loaded);
});