【发布时间】:2018-03-19 01:30:27
【问题描述】:
我对 Ionic 真的很陌生,所以这可能是一个简单的,但我还不知道。所以请帮助
我想从我的应用程序从 Google 驱动器下载一个文件夹到 Android /Ios 并在应用程序中使用它。
我以为我可以使用与下载普通文件相同的代码,但它不起作用。
我使用的代码是---
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(directory) {
var fileTransfer = new FileTransfer();
console.log(directory.root);
fileTransfer.download(
encodeURI("https://drive.google.com/open?id=0B6tGuVQgFM6vM1Rjelsdadadaas"),
directory.root.nativeURL + 'course1',
function(entry) {
console.log("download complete: " + entry.fullPath);
},
function(error) {
console.log(error);
console.log("download error source " + error);
console.log("download error target " + error.target);
console.log("upload error code" + error.code);
},
false
);
}, function(err){console.error(err)});
我没有收到任何错误,但在我的 android 设备的项目名称/文件/文件夹中看不到任何新文件。
请帮忙,我想下载一个完整的文件夹/或者是否可以下载一个 zip 并将其解压缩到某个位置?/
请提出建议。
提前致谢
【问题讨论】:
标签: ionic-framework cordova-plugins ngcordova