?? upload.asp
字號:
<!--#include file="check.asp"-->
<!--#include file="upload.inc"-->
<html>
<head>
<title>圖片上傳</title>
<style>
td{font-size:9pt;line-height:140%}
body{font-size:9pt;line-height:140%}
a:link { color: #0033CC; text-decoration: none }
a:visited { color: #0033CC; text-decoration: none }
a:hover { color: #4D9CC8; text-decoration: underline}
</style>
</head>
<body topmargin="0" leftmargin="0">
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xSoft ''建立上傳對象
'response.write upload.Version&"<br><br>" ''顯示上傳類的版本
if upload.form("filepath")="" then ''得到上傳目錄
HtmEnd "請輸入要上傳至的目錄!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")
''在目錄后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if
iCount=0
for each formName in upload.file ''列出所有上傳了的文件
set file=upload.file(formName) ''生成一個文件對象
if file.FileSize>0 then ''如果 FileSize > 0 說明有文件數(shù)據(jù)
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
'fname=""&fname&"."&GetExtendName(file.FileName)&""
fname=""&fname&".gif"
file.SaveAs Server.mappath(formPath&fname) ''保存文件
tmp = "http://" & request.servervariables("SERVER_NAME") & _
left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("/go_flash/upload.asp"))
picurl=tmp&formPath&fname
picurl = replace(picurl,"..","")
end if
set file=nothing
next
set upload=nothing
'Htmend iCount&" 個文件上傳結(jié)束!"
sub HtmEnd(Msg)
set upload=nothing
end sub
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
if picurl<>"" then%>
請將圖片地址復(fù)制到上面:<input type=text name=T1 size=50 value=<%=picurl%>> [<a href="Javascript:history.go(-1)">繼續(xù)上傳</a>]
<%else%>請先選擇你要上傳的圖片 [<a href="Javascript:history.go(-1)">重新上傳</a>]<%end if%>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -