<%
' 下载文件
Funktion downloadfile(fullpath)
downloadfile = false
dim strfilename, s, fso, f, intfilelength
set fso = server.createobject("scripting.filesystemobject")
wenn nicht fso.fileexists(fullpath) dann
Funktion
beenden, wenn
festgelegt f = fso.getfile(fullpath)
'获取文件大小
intfilelength = f.size
set s = server.createobject("adodb.stream")
s.open
s.type = 1
s.loadfromfile(fullpath)
Antwort .buffer = true
Response.clear
'response.addheader "Content-Encoding","GB2312" '
response.addheader "content-type", "application/x-msdownload"
Response.addheader "content-disposition" ,"attachment;filename=" & f.name
Response.addheader "content-length" ,intfilelength
Response.contenttype = "application/octet-stream"
während nicht s.eos
Antwort.binarywrite s.read(1024 * 64)
Response.flush
wend
s.close
set s = Nothing
downloadfile = true
Endfunktion
%>