![](/img/trans.png)
[英]open exported excel file and try to save it, is saving as web page format
[英]How to automatically Open Exported Excel File
所以我有这段代码,我将导出字符串传递给excel
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=MyExcelData.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-excel"
Response.Output.Write(myDataString)
Response.Flush()
Response.End()
此代码要求我打开或保存文件。 我的问题是有没有一种方法可以自动打开文件而不要求我打开或保存文件???
不,它是浏览器/用户确定要做什么。 您可以尝试更改内容类型以显示“打开/保存”浏览器弹出窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.