bug adding file to chat on ios solved

This commit is contained in:
Equilibrium ITO
2024-03-11 11:18:32 +01:00
parent 63f3138162
commit c22efc99dc
8 changed files with 126 additions and 17 deletions
@@ -263,5 +263,17 @@ export class FileService {
return new File([u8arr], filename, {type:mime});
}
base64toBlobIos(base64Data, contentType) {
contentType = contentType || '';
const byteCharacters = atob(base64Data);
const byteArray = new Uint8Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteArray[i] = byteCharacters.charCodeAt(i);
}
return new Blob([byteArray], { type: contentType });
}
}