The official documentation for working with files in a phone saver can be quite complicated.
Here is a working example of listing files in a folder other than the root (in this case, one is called "Downloads").
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) { fileSystem.root.getDirectory("Downloads", { create: true }, function(directory) { var directoryReader = directory.createReader(); directoryReader.readEntries(function(entries) { var i; for (i=0; i<entries.length; i++) { log(entries[i].name); } }, function (error) { alert(error.code); }); } ); }, function(error) { alert("can't even get the file system: " + error.code); });
Please note that this will give you a directory in the recording area (documents on iOS, sdcard on Android, so that may not help much).
source share