ASP implementation Remote Save picture
<%
' Download remote pictures first
Url= "logo.gif" Remote picture address
Savepath= "D:\photo\" Save path
' Renaming a file
Randomize
Rannum=int (999*RND)
Filename=year (now) &month (now) &day
(now) &hour (now) &minute (now) &second
(now) &rannum
' End of File rename
Set Xmlhttp=server.createobject
("Microsoft.XMLHTTP")
Xmlhttp.open "Get", Url,false
Xmlhttp.send
img = xmlhttp. Responsebody
Set xmlhttp=nothing
Set Objadostream=server.createobject ("ADODB. Stream ")
Objadostream.open ()
Objadostream.type=1
Objadostream.write (IMG)
Objadostream.savetofile (savepath&filename& ". jpg")
Objadostream.seteos
Set objadostream=nothing
' End of File download
Set Upload = Server.CreateObject ("persits.upload") ' Open object
Set file = Upload.openfile (savepath&filename& ". jpg") ' Open a saved file
If File.imagetype <>
"JPG" and File.imagetype <>
"GIF" and File.imagetype <>
"BMP" and File.imagetype <>
"PNG" Then
Upload.deletefile savepath&filename& ". jpg" ' If the format is not correct delete this downloaded picture
Response.Write "Bad picture format"
End If
' Logoff instance
Set Upload = Nothing
Set File = Nothing
%>