Код: Выделить всё
convertAndDownload(base64Data: string, fileName: string) {
const byteCharacters = atob(base64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], { type: 'application/msword' });
saveAs(blob, fileName + '.doc');
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... -64-string
Мобильная версия