I pass the file to url, I could do it successfully, but I donโt know how to get the progress of the downloaded file, I need to make 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 don't know how to use, can someone give me some examples
Updated After going through the document 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 started, I could not see any of these consoles, I added this new code under the file transfer code. can someone help me
source share