📄 upload1.asp
字号:
<!--#include file="../inc/office_open.asp"-->
<%
'权限再次确认
oabusyusername=request.cookies("oabusyusername")
cook_allow_upload_file=request.Cookies("cook_allow_upload_file")
if oabusyusername="" or (not cook_allow_upload_file) then
response.redirect "../default.asp"
end if
'读出上传参数的设置
set conn=opendb
set rsUpload = Server.CreateObject("ADODB.Recordset")
Uploadsql = "SELECT * FROM UploadSet where id=2"
rsUpload.Open Uploadsql,conn
upset = rsUpload("upset")
nameset = rsUpload("nameset")
fileset = rsUpload("fileset")
If fileset < 1 Then
Response.write "<script>alert('对不起!附件上传功能已被关闭,请与系统管理员联系');history.back();</script>"
Else
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="styles.css">
<title>文件上传</title>
</head>
<body>
<form method="POST" name="form1" action="upfile1.asp" enctype="multipart/form-data">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="53">
<tr>
<td width="100%" height="21" bgcolor="#808080"> <font color="#FFFFFF"><b>附件上传</b></font></td>
</tr>
<tr>
<td width="100%" height="16"></td>
</tr>
<tr>
<td width="100%" height="16">
<table border="1" width="100%" cellpadding="2" bordercolordark="#FFFFFF" cellspacing="0" height="196">
<tr>
<td width="35%" bgcolor="#C0C0C0" height="22">允许上传附件的文件类型:</td>
<td width="65%" bgcolor="#F3F3F3" height="22"><%=(rsUpload("FileType"))%></td>
</tr>
<tr>
<td width="35%" bgcolor="#C0C0C0" height="22">允许上传附件的最大容量:</td>
<td width="65%" bgcolor="#F3F3F3" height="22"><%=((rsUpload("Size"))/1024)%>K</td>
</tr>
<% if upset > 1 then %>
<script language="javascript">
function setid()
{
str='<br>';
if(!window.form1.upcount.value)
window.form1.upcount.value=1;
if(window.form1.upcount.value><%=upset%>){
alert("您最多只能同时上传<%=upset%>个文件!");
window.form1.upcount.value = <%=upset%>;
setid();
}
else{
for(i=1;i<=window.form1.upcount.value;i++)
str+='<div align="center">'+i+':<input type="file" name="文件'+i+'" style="width:340" class="tx1"></div><br>';
window.upid.innerHTML=str+'<br>';}
}
</script>
<tr>
<td width="35%" bgcolor="#C0C0C0" height="22">可同时上传附件的个数:</td>
<td width="65%" bgcolor="#F3F3F3" height="22"><%=UpSet%>个</td>
</tr>
<tr>
<td width="35%" bgcolor="#C0C0C0" height="23">设置上传个数:</td>
<td width="65%" bgcolor="#F3F3F3" height="23">
<input type="text" class="tx" value="1" name="upcount" size="3">
<input type="button" name="Button" onClick="setid();" value="设定" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; COLOR: #ffffff; height:20px;background-color:#568ac2;" onMouseOver ="this.style.backgroundColor='#77A3D2'" onMouseOut ="this.style.backgroundColor='#568ac2'"></td>
</tr>
<% end if %>
<tr>
<td width="35%" bgcolor="#C0C0C0" height="23">选择上传附件:</td>
<td width="65%" bgcolor="#F3F3F3" height="23">请确保上传<font color="#FF0000">doc、txt</font>文件名不能为中文 </td>
</tr>
<tr>
<td width="100%" bgcolor="#F3F3F3" colspan="2" height="20" id="upid">
<p align="center"><input type="file" name="file1" style="width:340" class="tx1" value="" size="50"></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center" height="34"> <p align="center">
<input type="submit" value="粘贴附件" name="B1" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; COLOR: #ffffff; height:20px;background-color:#568ac2;" onMouseOver ="this.style.backgroundColor='#77A3D2'" onMouseOut ="this.style.backgroundColor='#568ac2'">
<input type="reset" value="重设" name="B2" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; COLOR: #ffffff; height:20px;background-color:#568ac2;" onMouseOver ="this.style.backgroundColor='#77A3D2'" onMouseOut ="this.style.backgroundColor='#568ac2'">
<input type="button" size="3" value="返回" name="Submit2" onclick="javascript:window.history.go(-1)" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; COLOR: #ffffff; height:20px;background-color:#568ac2;" onMouseOver ="this.style.backgroundColor='#77A3D2'" onMouseOut ="this.style.backgroundColor='#568ac2'">
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsUpload.close
conn.close
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -