hello I am trying to make simple application in ionic using camera or select file from gallery or file system and send to / or upload to a server. I found one plugin which capture one image and send base64 string here is plugin http://ngcordova.com/docs/plugins/camera/ using this I am able to get base64 string
$cordovaCamera.getPicture(options).then(function(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}, function(err) {
// error
});
that base64 string I used to send to server
But my problem is that when I use this plugin image gallary plugin
http://ngcordova.com/docs/plugins/imagePicker/ it send me only image url (where is in memory) .can we get base64 string after selecting the image from image picker.
$cordovaImagePicker.getPictures(options)
.then(function (results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function(error) {
// error getting photos
});
In other words when I using camera I am getting base64 string as shown above.But when I use image picker plugin I am getting image url.can I get base64 string .so that I am able to send or upload on server . how to convert image url to base64 string ?