How to convert base64 image to blob image in ionic?

devquora
devquora

Posted On: Jun 07, 2021

 

You can convert base64 image to blob image in ionic by first prepend content type data, for example you can use a JPEG image by:

const base64Response = await fetch(`data:image/jpeg;base64,${base64Data}`);

And then you can convert the given responce to a blob by:

const blob = await base64Response.blob();

Now,  you can upload it to a server, display it on the screen, etc.

 

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    IONIC Framework Interview Questions

    What is Ionic Framework?

    IONIC framework is an HTML5 platform that enables web developers to build hybrid mobile apps. Hybrid apps are those app..

    IONIC Framework Interview Questions

    What is the difference between PhoneGap, Cordova, and Ionic?

    Cordova: Cordova is a JavaScript framework that builds apps, which can access the device hardware. Cordova cannot buil..

    IONIC Framework Interview Questions

    Who developed Ionic framework?

    Ionic Framework was created by Drifty Co. in 2013 and developed by Max Lynch, Ben Sperry, and Adam Bradley...