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