2
我想下载一个excel文件(保存在服务器上)点击按钮。当事件引发它下载一个空白Excel文件,而不是 “WORK.xls”下载一个excel文件经典asp
<%
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
%>
什么问题你有? – 2014-09-12 22:38:55
一个空白的Excel文件被下载,而不是保存在服务器上的文件“WORK.xls” – Sash 2014-09-12 22:39:43