<%
' 下载文件
fungsi downloadfile(fullpath)
downloadfile = false
dim strfilename, s, fso, f, intfilelength
set fso = server.createobject("scripting.filesystemobject")
jika tidak fso.fileexists(fullpath) maka
fungsi keluar
berakhir jika
set f = fso.getfile(fullpath)
'获取文件大小
intfilelength = f.size
set s = server.createobject("adodb.stream")
s.open
s.type = 1
s.loadfromfile(fullpath)
respon .buffer = true
respon.clear
'response.addheader "Content-Encoding","GB2312" ' 乱码的解决方案
'response.addheader "content-type","application/x-msdownload"
respon.addheader "content-disposition" ,"attachment;filename=" & f.name
respon.addheader "content-length" ,intfilelength
respon.contenttype = "application/octet-stream"
sementara bukan s.eos
respon.binertulis s.baca(1024 * 64)
respon.flush
wend
s.close
set s = tidak ada
file download = true
fungsi akhir
%>