嗨,我正在制作一个起诉 phonegap 的 android 应用程序。这里我必须将 pdf 文档保存在手机内部存储器中。但它保存在手机 SD 卡中。请帮我将pdf文件保存在手机内存中我的代码是
var filename = "read-write.txt";
var filePath = "file:///sdcard/read-write.txt";
function saveFile(){
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccessSave,onErrorSave);
}
function onSuccessSave(fileSystem){
var sdcardEntry = fileSystem.root;
sdcardEntry.getFile(filename,{create: true}, gotFileEntry, failEntry);
}
function gotFileEntry(fileEntry){
fileEntry.createWriter(gotFileWriter, failWrite);
}
function gotFileWriter(fileWriter){
fileWriter.onwrite = function (evt) {
alert("Write was successful!");
document.getElementById("textarea").value = "";
};
fileWriter.write(document.getElementById("textarea").value);
}
function failWrite(error){
alert("Failed to get a file writer for " + filename);
}
function failEntry(error){
alert("Got error while reading " + filename + " " + error);
}
function onErrorSave(error){
alert("Got Error while gaining access to file system");
}
提前致谢!