I am trying to make a file download with ionic 3. This is the code that I use:
public download(file_name){
const fileTransfer: FileTransferObject = this.transfer.create();
fileTransfer.download(url, this.file.dataDirectory + 'file.png').then((entry) => {
const url = this.urlServe +'/documents/'+ this.name + this.id +'/'+ file_name;
this.view.dismiss({retornar:entry.toURL()});
}, (error) => {
this.view.dismiss({retornar:error.source});
});
}
The file supposedly if it is downloaded but when I see the URL that the Trasfer file returns to me is this:
file:///data/user/0/io.ionic.starter/files/file.png
This location can not be located anywhere on the device, I use Blu vivo XL, I would like it to be downloaded to the device downloads folder. If anyone has any suggestions, it would be very useful, thank you very much
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…