程序代碼:
<%
Response.Buffer = True
Dim objXMLHTTP, XML
Set xml = Server.CreateObject("Microsoft.XMLHTTP") '創建對象
XML.Open "GET","http://www.4guysfromrolla.com/webtech/code/mitchell-pres.zip",False ' '設置對象,具體xmlhttp詳細使用方法請見:http://www.cnsXML.com/blogvIEw.ASP?logID=273 《XMLHTTP 對象及其方法》一文
XML.Send '發送請求
Response.AddHeader "Content-Disposition", "attachment;filename=mitchell-pres.zip" '添加頭給這個文件
Response.ContentType = "application/zip" '設置輸出類型
Response.BinaryWrite XML.responseBody ’輸出二進制到浏覽器
Set XML = Nothing
%>