i am transferring file to a url, i could do it successfully but i dont know how to get the progress of the file that is been uploaded, i need to get progress in some numbers
fileTransfer.upload(file_path, api_endpoint, options, data)
.then((data) => {
// success
console.log("success", JSON.parse(data['response']));
this.upload_success();
}, (err) => {
// error
this.failed_upload();
console.log('File failed uploaded.', err);
})
i found onProgress(Listener) check in ionic2 documentation i dont know how to use could some one give me some examples
Updated After going through the doc https://github.com/apache/cordova-plugin-file-transfer#example-with-upload-headers-and-progress-events-android-and-ios-only
fileTransfer.onProgress = function(progressEvent) {
if (progressEvent) {
console.log("progress success =====")
} else {
console.log("progress error =====")
}
};
if i run i could not see any of those console i added this new code below the file transfer code. could some one help me