遠程圖片自動按檔案夾上傳到伺服器-默飛出品_小偷/採集

來源:互聯網
上載者:User

<html><head><meta http-equiv="content-Type" content="text/html; charset=gb2312"><title>遠程圖片自動按檔案夾上傳到伺服器-默飛出品</title><style type=text/css>a { text-decoration: none; color: blue }a:hover { text-decoration: underline }body { scrollbar-base-color: #F8F8F8; scrollbar-arrow-color: #698CC3; font-size: 12pt; background-color: #ffffff }</style><body topmargin="0" bgcolor="#F9F9F9"><%'遠程圖片自動按檔案夾上傳到伺服器'製作:默飛Server.ScriptTimeOut=99999savepath="upfiles" '圖片儲存路徑,可以根據自己的需要,進行修改,如沒有建立此檔案夾,系統將自動建立'QQ:33224360'HOME:http://mofei.xinxiu.com'EMAIL:mofei5@yahoo.com.cn'2005-10-15'著作權說明不影響資源,請保留著作權資訊imgpath=request("imgpath")if imgpath="" thenresponse.write "<form name=mofeiform method=post action=''><input type=text name=imgpath size=35> <input type=submit name=Submit001 value=上傳></form>在輸入框中輸入遠程圖片地址,如圖片不存在,程式自動放棄本次操作.製作:默飛QQ:33224360示範:http://mofei.xinxiu.com<font color=red>http://www.dns.com.cn</font><b>網域名稱65元,空間聯絡默飛可以享受八折優惠,<font color=red>信賴</font>默飛衝天....</b>"elsefilepath02=mofeifoldfso(savepath)savepath=savepath&"\"&year(now())&month(now())filepath02=mofeifoldfso(savepath)urname01=myreplace(imgpath)end if</P><P>function myreplace(str)newstr=strset objregEx = new RegExpobjregEx.IgnoreCase = trueobjregEx.Global = trueobjregEx.Pattern = "http://(.+?)\.(jpg|gif|png|bmp)" '定義檔案尾碼,可以增加你需要的尾碼,按規律增加.set matches = objregEx.execute(str)for each match in matchesnewstr=replace(newstr,match.value,saveimg(match.value))nextmyreplace=newstrend function</P><P>function saveimg(url)temp=split(url,".")filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&temp(ubound(temp))'檔案名稱重新命名結束set xmlhttp=server.createobject("Microsoft.XMLHTTP")xmlhttp.open "get",url,falsexmlhttp.sendimg=xmlhttp.ResponseBodyset xmlhttp=nothingset objAdostream=server.createobject("ADODB.Stream")objAdostream.Open()objAdostream.type=1objAdostream.Write(img)if objAdostream.size<200 thenresponse.write "<font color=red>沒找到內容!</font>[返回]"response.endend ifobjAdostream.SaveToFile(server.mappath(savepath&"\"&filename))objAdostream.SetEOSset objAdostream=nothingimgpath01=savepath&"\"&filename '返回圖片路徑imgpath01=replace(imgpath01,"\","/")response.write ("圖片上傳成功! [繼續上傳]") response.write ("<font color=red>http://www.dns.com.cn</font><b>網域名稱65元,空間聯絡默飛可以享受八折優惠,<font color=red>信賴</font>默飛衝天....</b>") 'adresponse.write ("") '根據你的系統需要,更改返回方式.end function</P><P>Function mofeifoldfso(mpath)Set fso = Server.CreateObject("Scripting.FileSystemObject")if not fso.FolderExists(server.Mappath(mpath)) then fso.Createfolder(server.mappath(mpath))set fso=nothingEnd Function%></P><P></body></html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.