typescript blob to base64

Solutions on MaxInterview for typescript blob to base64 by the best coders in the world

showing results for - "typescript blob to base64"
Luigi
30 Feb 2019
1You can do it by using FileReader as follows: 
2
3convertBlobToBase64 = (blob) => new Promise((resolve, reject) => {
4    const reader = new FileReader;
5    reader.onerror = reject;
6    reader.onload = () => {
7        resolve(reader.result);
8    };
9    reader.readAsDataURL(blob);
10});
11
12const base64String = await convertBlobToBase64(blob);