【发布时间】:2014-09-13 06:43:40
【问题描述】:
我正在尝试通过单击按钮下载一个 excel 文件(保存在服务器上)。引发事件时,它会下载一个空白的 excel 文件而不是“WORK.xls”
<%
strFile = "WORK.xls"
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFile
set app = Server.CreateObject("ADODB.Stream")
app.open
app.type = adTypeBinary
app.LoadFromFile(Server.MapPath("WORK.xls"))
response.binarywrite app.Read
app.close
Set app = nothing
%>
【问题讨论】:
-
您遇到了什么问题?
-
一个空白的excel文件被下载,而不是服务器上保存的文件“WORK.xls”
标签: excel asp-classic