在 html 中使用超链接下载 excel

download excel with an hyperlink in html

我正在尝试从 angular 应用程序下载 excel,作为其中的一部分,我创建了一个名为 Files

的子文件夹
<p><a href="/Files/MyList.xlsx" download target="_self"> Click to Download </a></p>

通过使用上面的代码,当我单击超链接时,正在下载一个文件并显示 Failed- No file.

之类的错误

我在 SO 中阅读了很多问题,在所有问题中,解决方案是将文件放入文件夹并下载,就像我所做的那样,创建 Files 文件夹并将我的文件保存在那里,仍然得到同样的错误。

<a href="https://www.smartsheet.com/file/ic-project-timeline-template-8857xlsx" >Download Excel Template</a>

我这样做过 |我没有遇到任何问题 |问题完全出在你的 xls 文件中.......