ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Life >

[ASP]Save remote files to local

Thursday on August 9th, 2007Life

Save remote files to local ASP code.

File:Get.asp'=================================================='Procedure name: SaveRemoteFile'Purpose: Save remote files to local'Parameter: LocalFileName -----Local File Name' RemoteFileUrl -----Remote File URL'==================================================sub SaveRemoteFile(LocalFileName,RemoteFileUrl)dim Ads,Retrieval,GetRemoteDataSet Retrieval = Server.CreateObject("Microsoft.XMLHTTP")With Retrieval.Open "Get", RemoteFileUrl, False, "", "".SendGetRemoteData = .ResponseBodyEnd WithSet Retrieval = NothingSet Ads = Server.CreateObject("Adodb.Stream")With Ads.Type = 1.Open.Write GetRemoteData.SaveToFile server.MapPath("pic/"&LocalFileName),2.Cancel().Close()End WithSet Ads=nothingend sub

Call: SaveRemoteFile "test.gif","/images/logo.gif"

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/life/ASP-Save-remote-files-to-local.htm