上传页面源码如下:sub shangchuan(wjj,lx,dx,xz,myform,txt,lj,fs)
if request("chuan") = "yes" then
set c=new clsUp
c.AllowExt=lx&";" '限制文件格式
c.SetFileSize(dx*2048) '最大文件大小
randomize
ranNum=int(900*rnd)+100
wj=trim(year(date()))&right("0"&trim(month(date)),2)&right("0"&trim(day(date)),2)&right("0"&trim(hour(time())),2)&right("0"&trim(minute(time())),2)&right("0"&trim(second(time())),2)&ranNum
wz=wjj&"/"&wj
FSPath=server.MapPath(wz)
'response.write""&FSPath&""
'response.end
if c.iserr then
Response.Write c.errmessage
Response.end
else
tp=c.AutoSave("file",FSPath&"/")
dx=c.Filesize
if xz=1 then
response.write "上传成功 [<a href=# onclick=history.go(-1)>继续上传</a>]"
else
response.write "上传成功"
end if
end if
set c=nothing
Select case fs
case 2
response.write "<script>parent."&myform&"."&txt&".value=''</script>"
case 1
response.write "<script>parent."&myform&"."&txt&".value+=''</script>"
case else
response.write "<script>parent."&myform&"."&txt&".value='"&lj&""&tp&"'</script>"
End Select
else
Response.Write "<form name=form method=post action=?chuan=yes enctype=multipart/form-data><input name=file type=file class=wenbenkuang size=25>"&_
" <input name=Submit type=submit class=wenbenkuang value=上传 onSubmit=javascript:document.form.submit;>只允许"&dx&"k以下,"&replace(lx,";","或")&"格式</form>"
end if
end sub
%>做真实的自我!~
帖子2 精华0 积分12 阅读权限40 性别男 来自浙江 在线时间13 小时 注册时间2006-8-14 最后登录2008-7-9 查看个人网站 查看详细资料TOP