How to upload image to server through API


#1

i’m working on user registration form i have to send the data to API in JSON
but i’m confused how to send the image.Finding a way to image uploading which works for both IOS and Android platform


#2

The image data captured from camera can be sent to webservice.

this.camera.getPicture(options).then((imageData) => {

      let base64Image = 'data:image/jpeg;base64,' + imageData; 
      /* use base64Image above to show image in IMG tag, and use 'imageData' to send to your webservice */

    }, (err) => {
    });

#3

i have to select it from the gallery for that i have used the ImagePicker Plugin i got the image
now show i have to use Base64 Plugin to convert and send it to api