Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

typescript blob to base64

You can do it by using FileReader as follows: 

convertBlobToBase64 = (blob) => new Promise((resolve, reject) => {
    const reader = new FileReader;
    reader.onerror = reject;
    reader.onload = () => {
        resolve(reader.result);
    };
    reader.readAsDataURL(blob);
});

const base64String = await convertBlobToBase64(blob);
Comment

PREVIOUS NEXT
Code Example
Typescript :: function that redirects to another page react 
Typescript :: angular change element style on click 
Typescript :: define array in typescript react useState 
Typescript :: mat dialog block scroll 
Typescript :: how to find uncommon elements in two lists in python 
Typescript :: combine two lists c# 
Typescript :: router navigate pass params 
Typescript :: how to send data between components in react with redirect 
Typescript :: how to check if its a character in r 
Typescript :: typescript method comments 
Typescript :: mongoose typescript npm 
Typescript :: sql check exists stored procedure 
Typescript :: fetch in ts 
Typescript :: get string in brackets python 
Typescript :: ts error type 
Typescript :: typescript dictionary object 
Typescript :: install snowpack 
Typescript :: how to scrape bing search results using python 
Typescript :: angular append array to another 
Typescript :: type usestate typescript 
Typescript :: debounce typescript 
Typescript :: array with objects read element with the lowest value 
Typescript :: apexcharts pie chart colors 
Typescript :: python requests use proxy 
Typescript :: requirements of fortnite 
Typescript :: git rebase two commits to one 
Typescript :: ts singleton pattern 
Typescript :: --skip tests generate components - Angular 12 - skip-tests vs spec-false 
Typescript :: make foreign key sql in exists row 
Typescript :: input type file in html events angular 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =