"Tim" <Ci************@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi all,
I would like to reference a remote image, such as
http://www.mysite.com/pic.jpg and save it to a local folder such as
c:\pics
Can this be done with ASP?
I have played with many image manipulation components and none of them
perform this fuction.
Thanks in advance
Tim
Will this help? Watch for word-wrap.
<% Option Explicit
'*
'* Declare Constants
'*
Const cFIL = "pic.jpg"
Const cOUT = "c:\pics\"
Const cURL = "http://www.mysite.com/"
'*
'* Fetch File
'*
Dim objXML
'Set objXML = CreateObject("MSXML2.XMLHTTP")
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", cURL & cFIL, False
objXML.Send
Dim binXML
binXML = objXML.ResponseBody
Set objXML = Nothing
'*
'* Save File
'*
Dim objADO
Set objADO = CreateObject("ADODB.Stream")
objADO.Type = 1
objADO.Open
objADO.Write binXML
objADO.SaveToFile cOUT & cFIL,2
Set objADO = Nothing
'*
'* Finish
'*
Response.Write cFIL & " downloaded."
%>