我正在尝试保存此示例的pdf文件:
http://gonehybrid.com/how-to-create-and-display-a-pdf-file-in-your-ionic-app/
到我的localData.我发现我需要文件插件,但我不知道如何将blob文件保存到我的系统.我试过这两个:
$cordovaFile.writeFile(cordova.file.externalCacheDirectory, "file.pdf", pdf, true)
.then(function(success) {
console.log("file creato")
}, function(error) {
console.log("errore creazione file")
});
Run Code Online (Sandbox Code Playgroud)
要么
$cordovaFile.createFile(cordova.file.dataDirectory, $scope.pdfUrl, true)
.then(function (success) {
// success
}, function (error) {
// error
});
Run Code Online (Sandbox Code Playgroud)
但我不能存储它.我怎样才能做到这一点?