ASP執行文件下載
if filename<>"" then
fileurl=server.MapPath("../upfiles/down/") & "\" & filename
response.clear
response.contenttype="application/octet-stream"
response.AddHeader "content-disposition","attachment;filename=" + filename
set stream=server.CreateObject("ADODB.Stream")
stream.type=1
stream.open
stream.LoadFromFile fileurl
While not stream.eos
response.BinaryWrite stream.Read(1024 * 64)
wend
stream.Close()
set stream=nothing
response.flush
response.end()
end if
fileurl=server.MapPath("../upfiles/down/") & "\" & filename
response.clear
response.contenttype="application/octet-stream"
response.AddHeader "content-disposition","attachment;filename=" + filename
set stream=server.CreateObject("ADODB.Stream")
stream.type=1
stream.open
stream.LoadFromFile fileurl
While not stream.eos
response.BinaryWrite stream.Read(1024 * 64)
wend
stream.Close()
set stream=nothing
response.flush
response.end()
end if
申明
非源创博文中的内容均收集自网上,若有侵权之处,请及时联络,我会在第一时间内删除.再次说声抱歉!!!
博文欢迎转载,但请给出原文连接。