找回密码
 注册
搜索
热搜: 回贴

文件(包括图片格式)下栽程序

2010-1-31 07:55| 发布者: admin| 查看: 40| 评论: 0|原作者: 柳梦璃

<%
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))
%>


最新评论

相关分类

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏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.

返回顶部