文件上传

<% fuptype=session("fuptype") '上传类型,adv表示广告图片,pic表示产品图片 fupname=session("fupname") '传递文件名 frmname=session("frmname") '传递表单名 if fuptype="" or fupname="" or frmname="" then response.write "
" response.end end if %> <% set upload=new upload_5xsoft set file=upload.file("file1") if file.fileSize>0 then filename=fupname+"." '根据上一页传递过来的fupname决定主文件名 filenameend=file.filename filenameend=split(filenameend,".") '确定扩展名 n=UBound(filenameend) filename=filename&filenameend(n) if fuptype<>"db" then if file.fileSize>100000 then response.write "
" response.end end if end if if LCase(filenameend(n))<>"gif" and LCase(filenameend(n))<>"jpg" and LCase(filenameend(n))<>"swf" and LCase(filenameend(n))<>"htm" and LCase(filenameend(n))<>"mdb" then response.write "
" response.end end if if fuptype="adv" then savepath="../images/adv/"&filename '广告图片 elseif fuptype="pic" then savepath="../pic/digi/"&filename elseif fuptype="link" then savepath="../images/links/"&filename elseif fuptype="db" then savepath="./"&filename end if file.saveAs Server.mappath(savepath) response.write "文件上传成功!上传文件的物理路径为：" response.write ""&Server.mappath(savepath)&"
" response.write "点击预览上传的文件" response.write "
" %>
<% else response.write "
" response.end end if set upload=nothing session("fuptype")="" session("fupname")="" session("frmname")="" %>