<% function getHTTPimg(url) on error resume next dim http set http=server.createobject("MSXML2.XMLHTTP") Http.open "GET",url,false Http.send() if Http.readystate<>4 then exit function getHTTPimg=Http.responseBody set http=nothing if err.number<>0 then err.Clear end function function Save2Local(from,tofile) dim geturl,objStream,imgs geturl=trim(from) imgs=gethttpimg(geturl) Set objStream = Server.CreateObject("ADODB.Stream") objStream.Type =1 objStream.Open objstream.write imgs objstream.SaveToFile tofile,2 objstream.Close() set objstream=nothing end function %> <% call Save2Local(serverurl&picarray(i),picpath&"Web"&filename&".jpg") %>
(责任编辑:admin) |