XMLHTTP Download Remote Data Output to Browser

zhaozj2021-02-16  168

Using the XMLHTTP object to get remote data, then use binary to output to the client browser, let the client download data, this example gets a compressed package from a remote server, and outputs it to the browser to provide the customer download.

Program code: <% response.buffer = true Dim objxmlhttp, XML set XML = Server.createObject ("Microsoft.xmlhttp") 'creates an object XML.Open "get", "http://www.4guysfromrolla.com/webtech/ Code / mitchell-pres.zip ", false 'set object, specific XMLHTTP details see: http://www.cnsxml.com/blogview.asp? logid = 273" XMLHTTP object and method "

Xml.send 'Send Request Response.addHeader "Content-Disposition", "Attachment; FileName = mitchell-pres.zip" Add header to this file response.conteTtype = "Application / Zip" Set Output Type Response.binaryWrite XML. ResponseBody 'output binary to browser

SET XML = Nothing%> -------------------------------------------- - Ouyang Dongjie creation (please keep this information)

转载请注明原文地址:https://www.9cbs.com/read-9117.html

New Post(0)