利用xmlhttp對象獲取遠(yuǎn)程的數(shù)據(jù),然后用二進(jìn)制輸出到客戶瀏覽器,讓客戶下載數(shù)據(jù),此例從某一遠(yuǎn)程服務(wù)器獲取一個(gè)壓縮包,并且輸出到瀏覽器提供客戶下載.
程序代碼: xml.Send '發(fā)送請求 Set xml = Nothing
<%
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP") '創(chuàng)建對象
xml.Open "GET","
Response.AddHeader "Content-Disposition", "attachment;filename=mitchell-pres.zip" '添加頭給這個(gè)文件
Response.ContentType = "application/zip" '設(shè)置輸出類型
Response.BinaryWrite xml.responseBody ’輸出二進(jìn)制到瀏覽器
%>
----------------------------------------------
歐陽東杰 創(chuàng)作 (轉(zhuǎn)載請保留此信息)
www.cnsxml.com
QQ:2596812 MSN:xzskyweb@hotmail.com
----------------------------------------------