<!-- #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/UpPhoto/"&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/UpPhoto/"&UpFolder&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&""
On Error GoTo 0

UpMaxFileSize=SiteSettings("MaxPhotoSize")		'最大上传文件大小
UpClass="Photo"
%><!--#include FILE="inc/UpFile.asp"-->
<body topmargin=0  rightmargin=0  Leftmargin=0>
<script>
if(window.parent.document.form.FileName.value.length<1){parent.document.form.FileName.value="<%=FileName%>";}
parent.document.form.UpFileID.value='<%=AttachmentID%>';
document.oncontextmenu = new Function('return false');
</script>
<table width=100% height=25 class=a3><tr><td>图片已上传成功！（<a target=_blank href=<%=SaveFile%>><%=SaveFile%></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=a3>
<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
%>