Ionic - Profile Image Upload (Mobile / Deskptop)


How can i intuitively switch between uploading a profile image on a mobile and also a desktop.

If the user is on a mobile i can use the native camera object. However, if i there using browser what can i use to allow user to pic a file from there dekstop.

Also, is it better to save image as base64image or blob?

  presentActionSheet() {
        let actionSheet = this.actionSheetCtrl.create({
            title: 'Select Image Source',
            buttons: [
                    text: 'Load from library',
                    handler: () => {                        this.takeImage(;
                    text: 'Cancel',
                    role: 'cancel',

    takeImage(sourceType) {

        const options: CameraOptions = {
            quality: 100,
            sourceType: sourceType,
            saveToPhotoAlbum: false,
            correctOrientation: true
 => {

            let base64Image = 'data:image/jpeg;base64,' + imageData;

        }, (err) => {

Did you get any solution to pick image from dekstop using ionic?

This works for me: