⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsoupload.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="../chkuser.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/user.asp"-->
<!--#include file="inc/randomString.asp" -->
<% ProgressID = gen_key(10) %>
<%
username=Request.Cookies("username")
path=request("path")
if rshost("ifupload")=False then
response.redirect("../error.asp?error=ifupload")
response.end
end if
If path = "" or Instr(path,"..")>0 then
response.redirect("../error.asp?error=baderror")
Response.end
End if
checkpath="/"&Request.Cookies("username")
if lcase(checkpath)<>lcase(left(path,len("/"&Request.Cookies("username")))) then
response.redirect("../error.asp?error=baderror")
response.end
end if
%>
<html>
<head>
<title>上传文件</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../js/title.js"></script>
<script language="javascript">
function stopup(){
	window.opener.focus();
	window.close();
}
function check(){
 i=1;
 issel=0;
 obj=document.form1;
 while(eval('obj.file'+i))
 {
  obj1=eval('obj.file'+i);
  if(obj1.value!="")
   {issel=1;break;}
  i++;
 }
 if(!issel)
 {alert('请先选择要上传的文件。');
 obj.file1.focus();
 return false;}
document.form1.button.value='正在上传文件...'
document.form1.button.disabled=true;
myOpen(form1);
}
var i=0;//全局计数变量 
function Set1()
	{var iCount,str;
	iCount=window.form1.upcount.value
	str='<td></td>';
	if((!iCount)||(iCount==0))
		{iCount=1;
		window.form1.upcount.value=1;
		}
	if (iCount><%=rshost("filecount")%>)
		{
		window.form1.upcount.value=i-1;
		alert("每次最大允许上传<%=rshost("filecount")%>个文件");
		}
	else
		{window.form1.upcount1.value=0
		for(i=1;i<=iCount;i++)
			{
			str+='<div align="right"><font color=#858585>●</font>&nbsp;文件'+i+':<input type="file" name="file'+i+'" style="width:370" class="input">&nbsp;&nbsp;</div>';
			}
			window.upid.innerHTML=str+'<td></td>';
		}
		return false;
	}

function Set2()
   {var iCount,iV;
	iV=parseInt(window.form1.upcount1.value)
	iCount=parseInt(window.form1.upcount.value)
	if(iCount!=i-1)
		{iCount=i-1;}		
	if (i><%=rshost("filecount")%>)
		{
		window.form1.upcount.value=<%=rshost("filecount")%>;
		alert("每次最大允许上传<%=rshost("filecount")%>个文件");
		}
	else
		{
			if(i==1){i=2}
			if(iV==1){iCount=1;window.form1.upcount1.value=0;}
			{
			window.form1.upcount.value=iCount+1;
			window.upid.insertAdjacentHTML('beforeEnd','<div align="right"><font color=#858585>●</font>&nbsp;文件'+i+':<input type="file" name="file'+i+'" style="width:370" class="input">&nbsp;&nbsp;<br></div>');
			}
		}
	i++;
	return false;
	}
	
function Set3()
		{var iCount,str;
			iCount=window.form1.upcount.value	
			str='<td></td>';
			str+='<div align="right"><font color=#858585>●</font>&nbsp;文件1:<input type="file" name="file1" style="width:370" class="input">&nbsp;&nbsp;<br></div>';
			window.upid.innerHTML=str+'<td></td>';
			i=2;
			window.form1.upcount.value=1;
		}
//-->	  
</script>
</head>
<body oncontextmenu="return false";return true" onkeydown=return(!(event.keyCode==78&&event.ctrlKey))>
<table width="400" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="cccccc">
  <form name=form1 action="uploadsave.asp" method="post" enctype="multipart/form-data" onSubmit="return check()">
  <input name="filepath" type="hidden" value="<%=path%>">
    <tr>
      <td> <li></li>上传到:<%=path%></td>
    </tr>
  <tr>
    <td height="28" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;<font color=#858585>● </font> 上传文件数:
        <input type="text" name="upcount" style="width:142" value="3" class="input">
&nbsp;
      <input type="button" name="Button0" class="button" onClick="Set1();" value=" 设 定 ">
      <input name="Button2" type=Button class="button" onClick="return Set2();" value="增加文件">
      <input type="reset" name="Submit222" class="button" onClick="Set3();" value=" 重 置 ">
      <input type="hidden" name="upcount1" value="1" >    </td>
  </tr>
    <tr align="center" bgcolor="eeeeee">
      <td><table width="461" height="100%" border="0" align="center" cellpadding="4" cellspacing="0">
        <tr align="right" valign="middle">
          <td width="461" height="" id="upid"><font color=#858585>●</font>&nbsp;文件1:
              <input type="file" name="file1" style="width:370" class="input" value="">
&nbsp;&nbsp;</td>
        </tr>
        <script language="javascript">
	Set3();
	form1.upcount.value='3'
      </script>
      </table> <input name="button" type=submit class="button" value="开始上传"> 
      <input type=button value="取 消" class="button" onClick="stopup()"></td>
    </tr>
  </form>
</table>

<script language="javascript">
function myOpen(form){
	window.open("inc/fileUpProgress.asp?progressID=<%=ProgressID%>","","width=370,height=115,toolbar=no");
	var url=form.action;
	if (url.indexOf("?",0)==-1) {
		form.action = url+"?progressID=<%=ProgressID%>";
	}else{	
		form.action = url+"&progressID=<%=ProgressID%>";
	}
}
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -