我有一个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) => {
})
}