I\'m writing an Android application with Phonegap 1.4.1 and Sencha that downloads and reads pdf files. How can I check whether the file exists in the phone directory using e
If you need a boolean-compatible method...
function checkIfFileExists(path){
var result = false;
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
function(fileSystem){
fileSystem.root.getFile(
path,
{ create: false },
function(){ result = true; }, // file exists
function(){ result = false; } // file does not exist
);
},
getFSFail
); //of requestFileSystem
return result;
}