?? upfile.asp
字號:
<%OPTION EXPLICIT%>
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('網絡超時或您還沒有登陸!');window.location.href='login.asp';</script>"
response.End
end if
%>
<!--#include FILE="upload.inc"-->
<html><head><title>圖片上傳</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<%
dim upload,file,formName,formPath,iCount,sname
set upload=new upload_5xSoft ''建立上傳對象
response.write upload.Version&"" ''顯示上傳類的版本
if upload.form("filepath")="" then ''得到上傳目錄
HtmEnd "請輸入要上傳至的目錄!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")&year(now)&month(now)&"/"
''在目錄后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"&year(now)&month(now)&"/"
end if
iCount=0
for each formName in upload.file ''列出所有上傳了的文件
set file=upload.file(formName) ''生成一個文件對象
if file.FileSize>0 then ''如果 FileSize > 0 說明有文件數據
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
response.write "<br><center><font size=2 color=red>上傳成功,請復制下邊剪切板中內容而后粘貼到圖片剪切板內!</font></center><br>"
dim thename,fsobj,spp,paths
'文件更名
thename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&right(file.filename,4)
'response.write thename
spp=file.filename
file.filename=thename
file.SaveAs Server.mappath(formPath&file.FileName)
paths=server.mappath("../")&"\bjxGpic\"&year(now)&month(now)&"\"&spp
set fsobj=server.CreateObject("scripting.filesystemobject")
set fsobj=nothing
response.write "<center><input type=text size=40 value=bjxGpic/"&year(now)&month(now)&"/"&file.filename&"><button onclick=window.clipboardData.setData('text',this.previousSibling.value)>復制</button><br><br><a href='javascript:window.close()'><font color=red size=2>關閉窗口</font></a></center>"
iCount=iCount+1
end if
set file=nothing
next
set upload=nothing ''刪除此對象
response.write "<font color=red size=2>"
'Htmend iCount&" 個文件上傳成功!</font>"
sub HtmEnd(Msg)
set upload=nothing
response.write "<br>"&Msg&" [<a href='javascript:window.close()'><font color=red size=2>關閉窗口</font></a>]</body></html>"
response.end
end sub
Function GetPP
dim s
s=Request.ServerVariables("path_translated")
GetPP=left(s,instrrev(s,"\",len(s)))
End function
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -