Cordova camera plugin problem in File_Uri


#1

I am using IONIC 3.7.0 in my current project. In one requirement i need to use cordova camera plugin to take photo uri from image gallery. My every time time when i am trying to get the URI , i get the data_uri which is base64 long string.

I only need the file_uri of image to go further. Please suggest.

Code:

var options = {
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.FILE_URI
};
Camera.getPicture(options)
.then((imageData) => {
console.log(imageData);
this.fileToUpload = imageData;
const base64Image = “data:image/jpeg;base64,” + imageData;
this.preloadImage._img.src = base64Image;
this.codeservice.doProfileImageUpload(base64Image)
.subscribe(res => {
if(res.length()>0){
console.log(‘updated’);
}
})
}, (err) => {
console.log(err);
});