I have the following code snippet, which downloads a 64-encoded document of type docx, by uploading a lightweight file if you download the file:
downloadFile(index) {
const linkSource = 'data:application/msword;base64,' + index.documento;
const downloadLink = document.createElement("a");
const fileName = 'sample.doc';
downloadLink.href = linkSource;
downloadLink.download = fileName;
downloadLink.click();
}
When trying to encode a new file (try one of about 7.7MB), and downloading it gives me a "network error" download error. Maybe I am applying something wrong. By the way: https://stackoverflow.com/questions/51997848/angular-6-unable-to-convert-base64-to-pdf here take the example. Any idea how to download the .docx file