<!-- #include file="Setup.asp" -->
<!--#include FILE="inc/UpFile_Class.asp"-->
<%
if CookieUserName=empty then error2("您还未登录论坛")


if Request.ServerVariables("request_method") = "POST" then

'生成目录
on error resume next
Set fso = Server.CreateObject("Scripting.FileSystemObject")
strDir="UpFile/UpAttachment/"&year(now)&"-"&month(now)&""
if not fso.folderexists(Server.MapPath(strDir)) then fso.CreateFolder(Server.MapPath(strDir))
if Err=0 then UpFolder=""&year(now)&"-"&month(now)&"/"
UpFolder="UpFile/UpAttachment/"&UpFolder&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&""
On Error GoTo 0
<!-----附件分组设置----->
if SiteSettings("Maxup2")<>1 then		'最大上传文件大小
UpMaxFileSize=SiteSettings("MaxFileSize")
else
UpMaxFileSize=conn.execute("select Maxup2 from BBSXP_Roles where id="&UserRoleID&"")(0)
end if
<!-----附件分组设置----->
UpFileTypes=LCase(SiteSettings("UpFileTypes"))	'允许上传文件类型
UpClass="Forum"
%><!--#include FILE="inc/UpFile.asp"-->
<body topmargin=0  rightmargin=0  Leftmargin=0>
<script>
var FileMIME="<%=FileMIME%>"
if (FileMIME.split ('/')[0]=="image"){
img="[img]<%=SaveFile%>[/img]"
}else{
img="[url=<%=SaveFile%>][img]images/affix.gif[/img]<%=FileName%>[/url]"
}
parent.document.form.UpFileID.value+='<%=AttachmentID%>,';
parent.document.getElementById("UpFile").innerHTML+='<img src=images/affix.gif><a target=_blank href=<%=SaveFile%>><%=FileName%></a><br>';
parent.IframeID.document.body.innerHTML+=img;
document.oncontextmenu = new Function('return false')
</script>
<table cellpadding=0 cellspacing=0 width=100%  height=100% class=a4><tr><td><a target=_blank href=<%=SaveFile%>><%=SiteSettings("SiteURL")%><%=SaveFile%></a> [<a href=PostUpFile.asp>继续上传</a>] </td></tr></table>
<%else%>
<script>if(top==self)document.location='';</script>
<body topmargin=0  rightmargin=0  Leftmargin=0>
<form enctype=multipart/form-data method=Post action=?>
<table cellpadding=0 cellspacing=0 width=100% class=a4>
<tr><td width=100%><input type=file style=FONT-SIZE:9pt name=file style=width:100%></td><td><input style=FONT-SIZE:9pt type="submit" value=" 上 传 "></td></tr>
</table>
</form>
<%
end if
%>