?? upfile_link.asp
字號:
<!--#include file="upload.asp"-->
<!--#include file="Function.asp"-->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<style type="text/css">
<!--
.font_cl {
font-size: 12px;
line-height: 1.5em;
color: #000000;
text-decoration: none;
}
-->
</style>
<%
maxFileSize = 1500
upFileType = "gif,jpg,swf,png"
set upload = new upload_file
uploadType = upload.Form("type")
select case uploadType
case "photo" ''形象照片
savePath = "UploadPhotoPic/"
case "ad" ''廣告
savePath = "UploadAdPic/"
end select
for each formName in upload.file
set file = upload.file(formName)
if file.filesize < 100 then
AlertBack "請選擇要上傳的文件!"
end if
if file.filesize > (maxFileSize*1024) then
AlertBack "文件大小超過了限制,最大只能上傳" & CStr(maxFileSize) & "K的文件!"
end if
fileExt = LCase(Right(file.filename, 3))
fileExts = split(upFileType, ",")
isValidFile = false
for i=0 to ubound(fileExts)
if fileExt = trim(fileExts(i)) then
isValidFile = true
exit for
end if
next
if not isValidFile then AlertBack "這種文件類型不允許上傳!"
fileName = savePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&LCase(Right(file.filename, 4))
file.SaveToFile Server.mappath(fileName)
'response.write uploadType
'response.end
if uploadType = "photo" then
strJS = "<body bgcolor='#ECF5FF'><table align=center><tr><td class='font_cl' align=center>形象圖片上傳成功!</td></tr></table></body>"
end if
Response.Write strJS
set file=nothing
next
set upload=nothing
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -