ionic(v3.19.1):使用ionic-native / file无法看到创建的文件

时间:2018-02-06 11:32:21

标签: android ionic-framework ionic3

我使用插件ionic-native / file创建一个文件。 (docs/native/file/

源代码如下所示:

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 => {});

一切都在这一点上起作用。创建文件,然后填充内容。问题是该文件在Downloads文件夹中不可见。安装其他应用程序(FXexplorer)后,您可以看到该文件存在。

使用FXexplorer查看下载文件夹:

Download Folder with FXexplorer

使用Android下载管理器查看下载文件夹:

Download folder with the Android Download Manager

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

按照以下链接,它可能会对您有所帮助https://ionicframework.com/docs/native/file/