Last active
January 30, 2021 03:06
-
-
Save howtomakeaturn/4223999aad98f0229563135d6becb4f4 to your computer and use it in GitHub Desktop.
conver-blob-to-base64.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const convert = (blob) => { | |
var reader = new FileReader(); | |
return new Promise((resolve, reject) => { | |
reader.onloadend = () => { | |
var base64data = reader.result; | |
resolve(base64data); | |
} | |
reader.readAsDataURL(blob); | |
}); | |
} | |
const base64data = await convert(newBlob); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment