Correct, recent updates have broken this behavior (thanks to Nikki9696 for the article).
There are three workarounds listed:
- Stop using HTML files masquerading as XLS
- Unblock access to individual files (client side solution)
- or add the source of the files to the Trusted Locations list in Excel (client side solution)
The best thing to do is #1. You should not be serving files with one data type as another file type. It's always generated a warning for users. Many Office clients that otherwise know how to open XLS files (such as Office for iPad) will choke when presented with an HTML file masquerading as XLS.
Instead, use a library to generate a modern XLSX file (which can be opened by Office 2003 and newer). There are several solutions such as EPPlus, NPOI, and Open XML SDK.
In the future, be careful to use supported solutions rather than cobbling together a hack like serving a file with the wrong extension.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…