Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
765 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...