I am trying to download excel file in my angular 7 app using the mime type "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet," but when I'm trying to open the downloaded file it throws me some error saying - http://prntscr.com/ur1nc4.
Here is what I've done inorder to download the file
const filePath = "https://bviewstorage.blob.core.windows.net/9be306d9-acb1-4f25-a54f-5126e021ec6d/hrm/aabe5bd4-940a-4246-979c-581fdaa45808/Client_export_1592830934796-94f5d780-4007-4ae6-b802-53f4fe5509f2.xlsx"
const linkSource = "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet," + filePath;
const downloadLink = document.createElement("a");
downloadLink.href = linkSource;
downloadLink.download = "ExcelTemplate" + this.datePipe.transform(new Date(), "yyyy-MM-dd") + ".xlsx";
downloadLink.click();
I've even try to download the file path "xls" MIME type but still it throws same error.
Please let me know the ways to download the excel file.