I am trying to remove all the files from a folder using Cordova and Android, the problem is that all code I think, only shows how to remove FILES and not FILES FROM A FOLDER.
The problem is that I do not know the name of the files.
Here is a sample code to remove files (I need to remove FILES I do not know the name of a folder for)
var path = cordova.file.applicationStorageDirectory;
var filename = "arquivoABC.txt";
window.resolveLocalFileSystemURL(path, function(dir) {
dir.getFile(filename, {create:false}, function(fileEntry) {
fileEntry.remove(function(){
// The file has been removed succesfully
},function(error){
// Error deleting the file
},function(){
// The file doesn't exist
});
});
});