简体   繁体   中英

Ionic (v3.19.1): Created file is not visible using ionic-native/file

I create a file with the plugin ionic-native/file. ( docs/native/file/ )

The source code looks like this:

let path = this.file.externalRootDirectory + "Download";        

this.file.createFile(path, "test.txt", true).then(event => {
    this.file.writeExistingFile(path, "test.txt", "Hello 
        World!").then(event => {
           console.log('success');
        }).catch(event => {});
    console.log('success');
}).catch(event => {});

Everything works to this point. The file is created and then filled with content. The problem is that the file is not visible in the Downloads folder. After the installation of an additional App (FXexplorer) you can see that the file exists.

View of the Download folder with FXexplorer :

在此处输入图片说明

View of the Download folder with the Android Download Manager :

在此处输入图片说明

How can I solve this problem?

按照下面的链接它可能会帮助您https://ionicframework.com/docs/native/file/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM