Convert blob to base64

后端 未结 9 2100
无人共我
无人共我 2020-11-22 13:12

This is a snippet for the code that I want to do Blob to Base64 string:

This commented part works and that when the URL generated by this i

9条回答
  •  春和景丽
    2020-11-22 13:43

     var reader = new FileReader();
     reader.readAsDataURL(blob); 
     reader.onloadend = function() {
         var base64data = reader.result;                
         console.log(base64data);
     }
    

    Form the docs readAsDataURL encodes to base64

提交回复
热议问题