Reputation: 713
I'm new to Ionic. I wanted to select multiple images from the gallery and send to the server.
I'm using Ionic 4 "File Chooser" (https://ionicframework.com/docs/native/file-chooser) to select files and "File Transfer" to transfer file. From the "file chooser" I can select ONLY one file. But I wanted to select multiple files ( multiple images ).
Is this possible? If not what are the alternative solutions to select multiple images from the Gallery to transfer to the server.
There should be a solution for this as this is a common scenario.
Upvotes: 2
Views: 2289
Reputation: 13125
For an alternative you should check out Image Picker
which lists itself as:
Cordova Plugin For Multiple Image Selection
You can see it here
Seems usage is straightforward:
import { ImagePicker } from '@ionic-native/image-picker/ngx';
constructor(private imagePicker: ImagePicker) { }
...
this.imagePicker.getPictures(options).then((results) => {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, (err) => { });
Upvotes: 1