photo gallery is loaded quite well and if I select a photo,
return value is like
//file:///storage/sdcard/Android/data/com.i ---- packagename/cache/filename.jpg?153343
then I should post this image to firebase storage…
as to take photo then upload it is quite easy but I wonder how to do same work in this case.
after this alert alert(this.picdata);
there is no responses
async getFoto(){
try{
const options : CameraOptions={
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.FILE_URI,
quality: 50,
targetWidth: 600,
targetHeight: 600,
encodingType: this.camera.EncodingType.JPEG,
correctOrientation: true
}
this.camera.getPicture(options)
.then(file_uri => {this.picdata = file_uri;
alert(this.picdata);
//file:///storage/sdcard/Android/data/com.i ---- packagename/cache/filename.jpg?153343
this.mypicref.child(this.uidd()).child('pic.png')
.putString(this.picdata,'base64',{contentType:'image/jpeg'})
.then(savepic=>{
alert("save")
}).catch(error=>{
alert(error);
alert(error.message);
alert(error.code);
})
})
}catch(e){
}
}