mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-05 05:33:55 +01:00
19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
function base64ToBlob(Base64String,type="") {
|
|
byteString=atob(Base64String)
|
|
var ab = new ArrayBuffer(byteString.length);
|
|
var ia = new Uint8Array(ab);
|
|
for (var i = 0; i < byteString.length; i++) {
|
|
ia[i] = byteString.charCodeAt(i);
|
|
}
|
|
|
|
// write the ArrayBuffer to a blob, and you're done
|
|
var bb=null
|
|
if (type=="") {
|
|
var bb = new Blob([ab]);
|
|
}
|
|
else {
|
|
var bb = new Blob([ab], {type : type});
|
|
}
|
|
return bb;
|
|
}
|