1

I am developing an app like Instagram, and I get problem about getting picture after taking it from camera, I can get file from gallery by using input = 'file' type and put event.target.files to get File, but I am Confused at camera T_T , I want to get the image file and push it into my array then upload it to the server

this.camera.getPicture(options).then((imageData) => {
        let base64Image = 'data:image/jpeg;base64,' + imageData;
        console.log(base64Image);

        // let fileImage = imageData.target.files; <-- cant use this function
        // this.newPostData.media.files.push(fileImage);

}, (err) => {
            console.log(err);
});

if I use imageData.target.files I will get error files no promise, Please help me to solve my problem

  • Can you convert your base64 image string to file. [How to convert Base64 String to javascript file object like as from file input form?](https://stackoverflow.com/questions/35940290/how-to-convert-base64-string-to-javascript-file-object-like-as-from-file-input-f) – kukipei Aug 24 '17 at 15:19

0 Answers0