<!--#include file="fso.jsp"-->
<%
'wjj上传的文件夹位置
'lx上传的文件格式（ASP除外）
'dx上传文件限制大小，单位K
'xz是否允许重复上传.0否，1允许
'myform弹入表单名称
'txt弹入表单文本框
'lj弹入路径
'fs弹入方式，2带一UBB，1带UBB多次加，0无
'==================================================
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)
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='[img]"&lj&""&tp&"[/img]'</script>"
case 1
response.write "<script>parent."&myform&"."&txt&".value+='[img]"&lj&""&tp&"[/img]'</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
%>
