%
if session("admin")="" then
conn.close
set conn = nothing
response.Write ""
response.End
else
if request.cookies("timesshop")("admin")="" then
conn.close
set conn = nothing
response.Write ""
response.End
end if
end if
if session("rank")>2 then
conn.close
set conn = nothing
response.Write ""
response.End
end if
%>
<%
filepath="../images/upfile/" '上传路径
filepathname = "images/upfile/"
set upload=new clsUp '建立上传对象
upload.NoAllowExt="asp;asa;cer;aspx;cs;vb;js;" '设置上传类型的黑名单
upload.GetData (3072000) '取得上传数据,限制最大上传3M
if upload.form("act")="uploadfile" then
for each formName in upload.File
set file=upload.File(formName)
fileExt=lcase(file.FileExt) '得到的文件扩展名不含有.
if file.filesize<10 then
response.write "请先选择你要上传的文件! [ 重新上传 ]"
response.end
end if
if file.filesize>(3000*1024) then
response.write "最大只能上传 3000K 的图片文件! [ 重新上传 ]"
response.end
end if
dtNow=Now()
randomize
ranNum=int(90000*rnd)+10000
filename1=year(dtNow) & right("0" & month(dtNow),2) & right("0" & day(dtNow),2) & right("0" & hour(dtNow),2) & right("0" & minute(dtNow),2) & right("0" & second(dtNow),2) & ranNum &"."&fileExt
filename=filepath&filename1
filelstname=filepathname&filename1
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
upload.SaveToFile formName,Server.mappath(FileName)
'这里可以存数据库
response.write ""
%>
<%
end if
set file=nothing
next
set upload=nothing
end if
%>