下面的代码是我的上传控制代码。
<asp:FileUpload ID="FileUpload1" runat="server" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
它只会在上传控件中显示 Excel (.xlsx) 文件。如何让它也显示 Excel (.xls) 文件?
非常感谢您的评论!
最佳答案
accept
属性值可以设置为逗号分隔的字符串。
<asp:FileUpload
ID="FileUpload1"
runat="server" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
关于asp.net - 在上传控件中显示excel文件的所有版本(asp.net),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31552686/