I have successfully converted my base64 (DATA_URI) image into blob but not able to revert it back.
My base64 to blob code look like below for more info look this link.
b64toBlob(b64Data, contentType, sliceSize) {
contentType = contentType || '';
sliceSize = sliceSize || 512;
var byteCharacters = atob(b64Data);
var byteArrays = [];
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
var slice = byteCharacters.slice(offset, offset + sliceSize);
var byteNumbers = new Array(slice.length);
for (var i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
var blob = new Blob(byteArrays, {type: contentType});
return blob;
}
I am trying to convert my blob to base64 I get an error as
ERROR TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.
here is my response for getting back my blob image res 
I am invoking success callback but not able to under stand this
here is the code where I try to convert blob to base64
if(window.FileReader) {
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = () => {
var base64data = reader.result;
console.log(base64data);
}
}
While debugging i am not able to see reader.onloadend it is null and i am not able to invoke it.
Any help??
blobthat you're passing toreader.readAsDataURL()?"1524751188817_blob", I'm not sure you can get aBlobout of it. The functionb64toBlobthat you're using is expecting the first parameter to be a base64-encoded string.ØÿàJFIFHHÿáXExifMM*‡i& À Ðÿí8Photoshop 3.08BIM8BIM%ÔŒÙ²é€ ˜ìøB~ÿÀÐÀ"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br,....