离子使用FTP下载文件

时间:2017-09-14 15:04:44

标签: angular typescript ionic-framework ionic3 ionic-native

我的FTP插件(http://ionicframework.com/docs/native/ftp/)有问题。我想逐个从FTP下载一系列文件,一旦下载文件,应用程序应该读取文件并将数据插入数据库。问题是应用程序在下载100%之前读取文件,我不知道如何修复它。

根据文档,返回下载百分比,但是一旦达到100%(resDL = 1),我不知道如何启动该功能。

这是我的代码:

this.ftp.download(pathLocal+'lecturaData/'+filename, filename)
            .then((resDL: any)=>{
                if (resDL == 1) {
                    return this.FromFileToBBDD(this.file.externalDataDirectory+'lecturaData/', filename);
                }
            })
          .catch((error: any) => {
            console.error(error);
          });

非常感谢

0 个答案:

没有答案