📄 postupfile.asp
字号:
<!-- #include file="Cls.asp" -->
<!-- #include file="inc/ADO.asp" -->
<!--#include file="inc/UpFile_Class.asp"-->
<%
if Not IsUser then Error2("您还未登录论坛")
top "上传附件",false
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)&""
Set fso=Nothing
On Error GoTo 0
Dim UpMaxFileSize
if Cache("MaxUp2") then '最大上传文件大小
UpMaxFileSize=Int(Conn.Execute("select Maxup2 from [WxRoles] where id="&UserRoleID&"")(0))
else
UpMaxFileSize=Int(Cache("MaxFileSize"))
end if
'最大上传文件大小
UploadExt=Lcase(Cache("UploadExt"))'允许上传文件类型
UpClass="Forum"
%><!--#include file="inc/UpFile.asp"-->
<body>
<script type="text/javascript">
var FileMIME="<%=FileMIME%>"
if (FileMIME.split ('/')[0]=="image"){
var img="[img]<%=SaveFile%>[/img]"
}else{
var img="[url=<%=SaveFile%>][img]Images/affix.gif[/img]<%=FileName%>[/url]"
}
parent.document.form.UpFileID.value+='<%=AttachmentID%>,';
parent.document.getElementById("UpFiles").style.display="block";
parent.document.getElementById("UpFile").innerHTML+='<img src=Images/affix.gif><a target=_blank href=<%=SaveFile%>><%=FileName%></a>(<%=Cache("SiteUrl")%><%=SaveFile%>)<br />';
parent.insertHTML(""+img+"");
</script>
<div class="tc ac p3" style="width:350px;"><a href="PostUpFile.asp">文件上传成功,继续上传</a></div>
</body>
<%else%>
<script type="text/javascript">
if(top==self)document.location='';
function CheckFile(formobj){
if (formobj.file.value==""){alert("请选择要上传的文件");formobj.file.focus;return false;}
formobj.submit.disabled="disabled";
return true;
}
</script>
<body>
<form method="post" name="form" enctype="multipart/form-data" action="?" onsubmit="return CheckFile(this);">
<input type="file" style="font-size:9pt" name="file" style="width:250px;" /><input type="submit" name="submit" value=" 上 传 " /></form>
</body>
<%
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -