Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

How to convert an image to Blob

$
0
0

@olajhidey wrote:

I am having a bit issue with trying to convert my image to blob

file = "assets/imgs/profile.png"
//this is the image to be changed to a blob

let reader = new FileReader()

reader.readAsArrayBuffer(file);
              reader.onloadend = (evt: any) => {
                let imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
}

I am trying to upload the image to a REST API written in PHP laravel and its expecting the image in blob

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>