I am trying to make an app to list images like photo gallery in android. To do that, I used ngCordova camera plugin or Cordova image picker plugin. The plugins, however, need one-by-one image selection to get results by using touch event on photo library; plus, the limit option for the result. That is far from what I am going to. I am wondering how to retrieve all images rather than manual selection. Could you tell me how to approach?
Asked
Active
Viewed 1,160 times
1 Answers
1
cordova-file is what you are looking for.
You can use this function to get all available files in a folder:
function listDir(path){
window.resolveLocalFileSystemURL(path,
function (fileSystem) {
var reader = fileSystem.createReader();
reader.readEntries(
function (entries) {
console.log(entries);
},
function (err) {
console.log(err);
}
);
}, function (err) {
console.log(err);
}
);
}
//example: list of www/ folder in cordova/ionic app.
listDir(cordova.file.applicationDirectory + "directory/path");
see this also: Cordova list all files from application directory (WWW)

Mayank R Jain
- 3,127
- 1
- 29
- 43
-
i don't want our app directory.but it's done with "cordova.file.externalRootDirectory+"Foldername/"..thank u .thank u so much – kunal shaktawat Nov 16 '17 at 07:29