0

as I think , this will output the data of the image

let cameraOptions = {
      destinationType: this.camera.DestinationType.DATA_URL 
    }

but this will will output the path of the image

let cameraOptions = {
      destinationType: this.camera.DestinationType.FILE_URL 
    }

I want to output both - as long as I’ll upload the image data and need the path also

please mention this part in your answer if some changes required in it

this.camera.getPicture(cameraOptions).then((data) => {
       this.imgDate = 'data:image/jpeg;base64,' + data;
     });
AboMohsen
  • 109
  • 11

1 Answers1

1

You could achieve showing picture without URL. No need to upload first

let cameraOptions = {
    destinationType: this.camera.DestinationType.DATA_URL 
}
this.camera.getPicture(cameraOptions).then((data) => {
    this.imgData = 'data:image/jpeg;base64,' + data;
    this.sendToServer(this.imgData);//base64 server sending
});
<img [src]="imgData">
pavelety
  • 746
  • 6
  • 8