成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

XMLHTTP下載遠(yuǎn)程數(shù)據(jù)輸出到瀏覽器

瀏覽:60日期:2022-06-03 15:34:27

利用xmlhttp對(duì)象獲取遠(yuǎn)程的數(shù)據(jù),然后用二進(jìn)制輸出到客戶瀏覽器,讓客戶下載數(shù)據(jù),此例從某一遠(yuǎn)程服務(wù)器獲取一個(gè)壓縮包,并且輸出到瀏覽器提供客戶下載.   程序代碼:
  <%
  Response.Buffer = True
  Dim objXMLHTTP, xml
  Set xml = Server.CreateObject("Microsoft.XMLHTTP") "創(chuàng)建對(duì)象

  xml.Open "GET","http://www.4guysfromrolla.com/webtech/code/mitchell-pres.zip",False "   "設(shè)置對(duì)象,具體xmlhttp詳細(xì)使用方法請(qǐng)見:http://www.cnsxml.com/blogview.asp?logID=273  《XMLHTTP 對(duì)象及其方法》一文   xml.Send "發(fā)送請(qǐng)求

  Response.AddHeader "Content-Disposition", "attachment;filename=mitchell-pres.zip"  "添加頭給這個(gè)文件

  Response.ContentType = "application/zip" "設(shè)置輸出類型

  Response.BinaryWrite xml.responseBody "輸出二進(jìn)制到瀏覽器   Set xml = Nothing
  %>

  ----------------------------------------------
  歐陽東杰 創(chuàng)作 (轉(zhuǎn)載請(qǐng)保留此信息)
  www.cnsxml.com
  QQ:2596812 MSN:xzskyweb@hotmail.com
  ----------------------------------------------
(出處:風(fēng)閃網(wǎng)路學(xué)院)
標(biāo)簽: XML/RSS
相關(guān)文章: