I know this is late, but I've always had issues with the FileTransfer plugin. Maybe it is just me. I've instead had success with the writeFile()
method of the File plugin.
I'm still working on iOS, but for Android here is what I have:
import { File } from "@ionic-native/file";constructor(private fileSystem: File) {}
Then, in whatever function you have the logic to save the file, we have:
let path = this.fileSystem.externalRootDirectory +'/Download/'; // for Androidlet filename = 'myNewFile.pdf';this.fileSystem.writeFile(path, filename, File, { replace: true }).then(() => { this.toastCtrl.showToast('File has been downloaded. Please check your downloads folder.'); }, (err) => { alert("Sorry. An error occurred downloading the file: "+ err); });
As I said, I'm still looking out for what path to use for iOS. And I'm still wondering how to pop up the notification that usually comes up when a download actually goes to the download folder. But at least I am able to save directly in the download folder of Android.