如何备份SQlite DB并通过Ionic2将其上传到Google Drive?

时间:2017-12-15 08:15:01

标签: sqlite ionic2 google-drive-api

我有一个Ionic2应用程序。所有数据都存储在SQLite db中。当用户退出应用程序时,我需要备份sqlite并将其上传到Google云端硬盘。

有人可以帮我解决这个问题吗?

修改

添加了cordova插件以传输文件cordova-plugin-file-transfer

上传方法

upload() {
    let options: FileUploadOptions = {
        fileKey: 'file',
        fileName: '<file name>',
        headers: {<Authorization headers>}
    }

    fileTransfer.upload('<file path>', '<google drive api>', options)
        .then((data) => {

        }, (err) => {

        })
}

0 个答案:

没有答案