Does anyone know if it's possible to select multiple photos from an album using phonegap/cordova?
It's fairly easy to create an app to select one photo using the documentation but it is not documented how to select multiple photos???
Maybe I need some plugin for it (iOS/Android)? Or a workaround? This problem is really a show stopper for me so a decent solution to this would be great.
回答1:
Currently the functionality is not available in the core API. There is an enhancement request open however. At this point your best bet would be to write a plugin.
回答2:
For multiple selection I have made use of file plugin which iterates through all the directories recursively and finds the image . It ignores the hidden file
var numDirs = 0; var numFiles = 0; var ImageFilePath = new Array(); function GetAllImageFromSD() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail); } function onFileSystemSuccess(fileSystem) { fileSystem.root.getDirectory("/sdcard", { create: false, exclusive: false }, getDirSuccess, fail); } function getDirSuccess(dirEntry) { var directoryReader = dirEntry.createReader(); // Get a list of all the entries in the directory directoryReader.readEntries(readerSuccess, fail); } var readerTimeout = null, millisecondsBetweenReadSuccess = 1000; function readerSuccess(entries) { String.prototype.startsWith = function (str) { return (this.match("^" + str) == str) } var i = 0, len = entries.length; for (; i