<% function download(f,n) 'f文件全路径,n下载文件的文件名 on error resume next Set S=CreateObject("Adodb.Stream") S.Mode=3 S.Type=1 S.Open S.LoadFromFile(f) if Err.Number>0 then Reaponse.status="404" else Response.ContentType="application/octet-stream" Response.AddHeader "Content-Disposition:","Attachment;filename="&n Range=Mid(Request.ServerVariables("HTTP_RANGE"),50) if Range="" then Response.BinaryWrite(S.Read) else S.Postion=Clng(Split(Range,"-")(0)) Response.BinaryWrite(S.Read) end if end if Response.end end function dim filename filepath=Server.MapPath(".") path=request("path") path1=split(path,"/") call download(server.MapPath(path),path1(1)) %> |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )
GMT+8, 2024-9-30 07:19 , Processed in 0.157590 second(s), 12 queries , Gzip On, MemCache On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.