目前我正在开发一个项目,我必须访问可以在Root中找到的Music目录。我试图让与的PhoneGap /科尔多瓦插件目录:https://github.com/apache/cordova-plugin-file无法访问根目录phonegap
我试了很多东西,我做研究的谷歌,但找不到什么好.. 这里是我的代码:
/* THIS IS PLACED IN THE onDeviceReady FUNCTION! */
window.requestFileSystem(window.TEMPORARY, 1024*1024, onFileSystemSuccess, function(e) { alert("Something went wrong.."); });
alert("5");
/*************************************************/
function onFileSystemSuccess(fileSystem) {
alert("6"); // just for testing
fileSystem.root.getDirectory("Music", {}, getDirSuccess, function(e) { alert("Doesn't work"); });
}
function getDirSuccess(dirEntry) {
alert("7");
var directoryReader = dirEntry.createReader();
directoryReader.readEntries(readerSuccess,fail);
}
你能给我截图你想打开的文件位置吗? – Microsmsm
@Microsmsm http://prntscr.com/a790i5 – 247errorsnl