<% 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="../cert/" '上传路径 filepathname = "cert/" 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="bazs" filename1= 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 %>