Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
759 views
in Technique[技术] by (71.8m points)

angular - Location of the file downloaded on android using ionic

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...