asp下载保存远程文件
作者:刚子 日期:2009-11-13
程序代码<%
url="http://www.gangzi.org/"
filename="gangzi.html"
Set xml = Server.CreateObject("Msxml2.XMLHTTP")
xml.Open "GET",url,False
xml.Send
if Err.Number>0 then
Response.Status="404"
else
Response.ContentType="application/octet-stream"
Response.AddHeader "Content-Disposition:","attachment; filename=" & filename
Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
if Range="" then
Response.BinaryWrite(xml.responseBody)
else
S.position=Clng(Split(Range,"-")(0))
response.Write xml.responseBody
End if
end if
Response.End
Set xml = Nothing
%>
url="http://www.gangzi.org/"
filename="gangzi.html"
Set xml = Server.CreateObject("Msxml2.XMLHTTP")
xml.Open "GET",url,False
xml.Send
if Err.Number>0 then
Response.Status="404"
else
Response.ContentType="application/octet-stream"
Response.AddHeader "Content-Disposition:","attachment; filename=" & filename
Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
if Range="" then
Response.BinaryWrite(xml.responseBody)
else
S.position=Clng(Split(Range,"-")(0))
response.Write xml.responseBody
End if
end if
Response.End
Set xml = Nothing
%>
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: