I have a service with Springboot that send a File (Excel) in base64 to Angular6. I can't send the File directly for polity of security, so, I first convert my file a base64...
In my Angular I can recived base64 :
{
"file" : "UEsDBBQACAAIAJOOOU/kSK2vGAEAADMDAAATAAAAW0NvbnRlbnRfVHlwZXNdLnht"
}
The string file is more long...
However I when I try open this file, I get error in LibreOffice, "corrupt file"
this.data.getFile(endPoint).subscribe(
data => {
const myfile= atob(data.file);
const blob = new Blob([myfile], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
saveAs(blob, 'myfile.xlsx');
} );
EDIT:
It's the value the "myfile" =>
Please, I need help..
Angular doesn't error when I do saveAs(blob, 'myfile.xlsx');
but if I try open the file I get error.