📄 upload.asp
字号:
<!--#include file=conn.asp-->
<%
set rsmap = Server.CreateObject("ADODB.Recordset")
mapsql = "SELECT * FROM setmap"
rsmap.Open mapsql,conn
pathset = rsmap("pathset")
upset = rsmap("upset")
nameset = rsmap("nameset")
fileset = rsmap("fileset")
%>
<% if fileset < 1 then
Response.write "<script>alert('对不起�本上传功能被关闭了�');history.back();</script>"
else %>
<html>
<head>
<title>OA文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000FF}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="upfile.asp" enctype="multipart/form-data" >
<input type="hidden" name="act" value="upload">
<table width="472" border="1" cellspacing="0" cellpadding="5" align="center" bordercolordark="#CCCCCC" bordercolorlight="#000000" height="370">
<tr bgcolor="#CCCCCC">
<td height="16" align="left" valign="middle" bgcolor="#CCCCCC" width="463">
<div align="center"><font size="3"><b>OA文件上传系统Ver1.0</b></font></div>
</td>
</tr>
<tr align="left" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#eeeeee" height="156" valign="top" width="463"> <br>
<table width="463" border="0" cellspacing="1" cellpadding="2" align="center">
<tr>
<td width="457"><b><font color="#FF0000">*</font></b>上传的文件类型:<font color="#FF0000"><%=(rsmap("leixin"))%></font></td>
</tr>
<tr>
<td width="457"><font color="#FF0000"><b>*</b></font>上传的文件大小不能超过<font color="#FF0000"><%=(rsmap("size"))%></font>个字节</td>
</tr>
<tr>
<td width="457">
<% if upset > 1 then %>
<b><font color="#FF0000">*</font></b>每次可以设置同时上传<font color="#FF0000"><%=(rsmap("upset"))%></font>个文件。<br>
<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%>个文件0");
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="file'+i+'" style="width:400" class="tx1"></div><br><br>';
window.upid.innerHTML=str+'<br>';}
}
</script>
设置上传的个数
<input type="text" class="tx" value="1" name="upcount" size="20">
<input type="button" name="Button" class="bt" onClick="setid();" value="· 设定 ·">
<% end if %>
</td>
</tr>
<tr>
<td width="457">
<% if pathset = 1 then %>
<b><font color="#FF0000">*</font></b>请设置你要上传的文件路径:
<select name="filepath">
<option value="upfile/map/" selected>图片类型</option>
<option value="upfile/soft/">软件类型</option>
<option value="upfile/txt/">文件类型</option>
</select>
<% end if %>
</td>
</tr>
<tr>
<td width="457">
<% if nameset > 1 then %>
<font color="#FF0000"><b>*</b></font><font color="#0033FF">请尽量使用英文或数字作为文件名!</font>
<% end if %>
</td>
</tr>
</table>
</td>
</tr>
<tr align="center" valign="middle">
<td align="left" id="upid" height="110" width="463">
<div align="center">文件1:
<input type="file" name="file1" style="width:400" class="tx1" value="" size="50">
</div>
</td>
</tr>
<tr align="center" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#eeeeee" height="16" width="463">
<input type="submit" name="Submit" value="· 提交 ·" class="bt">
<input type="reset" name="Submit2" value="· 重执 ·" class="bt">
</td>
</tr>
<tr align="center" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#CCCCCC" height="12" width="463">版权所有 © 2001-2004 <a href="http://www.e169.net" target="_blank">www.e169.net</a></td>
</tr>
</table>
</form>
<% end if %>
</body>
</html>
<%
rsmap.Close
set rsmap=nothing
conn.close
set conn=nothing
%>
<script language="javascript">
setid();
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -