LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網站管理員

遠程圖片自動按文件夾上傳到服務器

admin
2011年2月16日 0:32 本文熱度 3964

<%
'遠程圖片自動按文件夾上傳到服務器


Server.ScriptTimeOut=99999
savepath="upfiles" '圖片保存路徑,可以根據(jù)自己的需要,進行修改,如沒有創(chuàng)建此文件夾,系統(tǒng)將自動創(chuàng)建


imgpath=request("imgpath")
if imgpath="" then
response.write "<form name=mofeiform method=post action='uppic.asp'><input type=text name=imgpath size=35> <input type=submit name=Submit001 value=上傳></form><br>在輸入框中輸入遠程圖片地址,如圖片不存在,程序自動放棄本次操作.<BR>"
else
filepath02=mofeifoldfso(savepath)
savepath=savepath&"\"&year(now())&month(now())&"\"&day(now())
filepath02=mofeifoldfso(savepath)
urname01=myreplace(imgpath)
end if


function myreplace(str)
newstr=str
set objregEx = new RegExp
objregEx.IgnoreCase = true
objregEx.Global = true
objregEx.Pattern = "http://(.+?)\.(jpg|gif|png|bmp)" '定義文件后綴,可以增加你需要的后綴,按規(guī)律增加.
set matches = objregEx.execute(str)
for each match in matches
newstr=replace(newstr,match.value,saveimg(match.value))
next
myreplace=newstr
end function


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,false
xmlhttp.send
img=xmlhttp.ResponseBody
set xmlhttp=nothing
set objAdostream=server.createobject("ADODB.Stream")
objAdostream.Open()
objAdostream.type=1
objAdostream.Write(img)
if objAdostream.size<200 then
response.write "<font color=red>沒找到內容!</font>[<a href=# onclick=history.go(-1)>返回</a>]"
response.end
end if
objAdostream.SaveToFile(server.mappath(savepath&"\"&filename))
objAdostream.SetEOS
set objAdostream=nothing
imgpath01=savepath&"\"&filename '返回圖片路徑
imgpath01=replace(imgpath01,"\","/")
response.write ("圖片上傳成功! [<a href=# onclick=history.go(-1)>繼續(xù)上傳</a>]")
response.write ("<br><img src="&imgpath01&" border=0 alt=默飛制作>") '根據(jù)你的系統(tǒng)需要,更改返回方式.
end function


Function mofeifoldfso(mpath)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(server.Mappath(mpath)) then fso.Createfolder(server.mappath(mpath))
set fso=nothing
End Function
%>


該文章在 2011/2/16 0:32:54 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業(yè)務管理,結合碼頭的業(yè)務特點,圍繞調度、堆場作業(yè)而開發(fā)的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產管理,WMS管理系統(tǒng),標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

黄频国产免费高清视频,久久不卡精品中文字幕一区,激情五月天AV电影在线观看,欧美国产韩国日本一区二区
最新国产人成视频 | 午夜一区二区三区不卡视频 | 日韩欧美一区二区在线蜜桃 | 日本中文字幕亚洲乱码视频 | 亚洲日本在线在线看片 | 五月天丁香婷婷最新 |