use something like:
function exists(fileName, callback) {
storageRootEntry.getFile(fileName, {create : false}, function() {
callback(true);
}, function() {
callback(false);
});
}
where storageRootEntry
is correctly initialized root directory. The function will returns "true" if file exists and "false" otherwise. The key point here is second parameter {create : false}