0
httpModuleを使用して、ドロップボックスレストサービスを呼び出してテキストファイルをダウンロードしています。内部のストレージにダウンロードすると、幸せそうに見えますが、デフォルトのアプリケーションでテキストファイルを開くことができません。今、私は外部ストレージにダウンロード場所を指していますが、エラー: 'エラー:パス:/ storage/emulated/0/myNewDirでファイルを保存できません'というメッセージが表示されます。私はあなたのwrite_external_storageとread_external_storageパーミッションをマニフェストに追加しました。ここに私のコードは次のとおりです。パスでファイルを保存できません
HomePage.prototype.getFile = function() {
var filePath = fs.path.join(fs.knownFolders.currentApp().path, "myFile.txt");
storage.createDirectory("myNewDir");
httpModule.getFile({
url: "https://content.dropboxapi.com/2/files/download",
method: "POST",
headers: { "Content-Type": "",
"Dropbox-API-Arg": JSON.stringify({"path": "/path/file"}),
"Authorization": "*****" },
}, storage.buildAbsolutePath()+"/myNewDir").then(function (response) {
console.log(JSON.stringify(response));
}, function (e) {
console.log("Error occurred " + e);
});}
感謝:) – arnestone