?? upload.asp
字號(hào):
<!--#include file="upload.inc"-->
<style>
td{font-size:9pt;line-height:120%;color:#353535}
body{font-size:9pt;line-height:120%}
a:link { color: #000000; text-decoration: none }
a:visited { color: #000000; text-decoration: none }
a:active { color: #000000; text-decoration: none }
a:hover { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
<%
set upload=new upload_file
if upload.form("act")="uploadfile" then
filepath=trim(upload.form("filepath"))
filelx=trim(upload.form("filelx"))
i=0
for each formName in upload.File
set file=upload.File(formName)
fileExt=lcase(file.FileExt) '得到的文件擴(kuò)展名不含有.
if file.filesize<100 then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">請(qǐng)先選擇你要上傳的文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
if (filelx<>"swf") and (filelx<>"jpg") and (filelx<>"asp") then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">該文件類型不能上傳! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
if filelx="swf" then
if fileext<>"swf" then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">只能上傳swf格式的Flash文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
if filelx="jpg" then
if fileext<>"gif" and fileext<>"jpg" then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">只能上傳jpg或gif格式的圖片! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
if filelx="swf" then
if file.filesize>(6000*1024) then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">最大只能上傳 6M 的Flash文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
if filelx="jpg" then
if file.filesize>(6000*1024) then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">最大只能上傳 6m 的圖片文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
if filelx="asp" then
if fileext<>"asp" then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">只能上傳上傳ASP格式文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
if filelx="asp" then
if file.filesize>(6000*1024) then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">只能上傳swf格式的Flash文件! [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if
end if
randomize
ranNum=int(90000*rnd)+10000
filename=filepath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
%>
<%
if file.FileSize>0 then ''如果 FileSize > 0 說(shuō)明有文件數(shù)據(jù)
'file.SaveAs Server.mappath(filename) ''保存文件
file.SaveToFile Server.mappath(FileName)
'response.write file.FileName&" 上傳成功! <br>"
'response.write "新文件名:"&FileName&"<br>"
'response.write "新文件名已復(fù)制到所需的位置,可關(guān)閉窗口!"
if filelx="swf" then
response.write "<script>window.opener.document."&upload.form("FormName")&".size.value='"&int(file.FileSize/1024)&" K'</script>"
end if
response.write "<script>window.opener.document."&upload.form("FormName")&"."&upload.form("EditName")&".value='"&FileName&"'</script>"
%>
<%
end if
set file=nothing
next
set upload=nothing
end if
%>
<script language="javascript">
window.alert("文件上傳成功!");
window.close();
</script>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -