<%
' Download remote pictures first
Url=\ "Http://www.im286.com/image ... ' 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
' 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\") ' Opens the saved file
If file.imagetype <> \ "jpg\" and File.imagetype <> "gif\" and File.imagetype <> \ "Bmp\" and File.imaget Ype <> \ "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
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service