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

📄 progress_upload.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="../chkuser.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/user.asp"-->
<%

Server.ScriptTimeOut=999999
maxsize=rshost("uploadsize")
filetype=rshost("filetype")
Set Upload = Server.CreateObject("Persits.Upload")
dir=Request.QueryString("dir")
Upload.ProgressID = Request.QueryString("PID")
Upload.SetMaxSize maxsize*1024, True
On Error Resume Next
Count = Upload.Save(userdir&dir)
If Err <> 0 Then 
      Response.Write "出现错误: " & Err.Description 
end if 
If Err.Number = 8 Then 
   Response.write "<script language='javascript'>alert('对不起,文件大小不能超过"&maxsize&"K,请返回重试!');location.href='javascript:history.back()'</script>" 
   Response.end
end if
For Each File in Upload.Files
types=lcase(mid(file.filename,InStrRev(file.filename, ".")+1))
if filetype<>"" then
filetype=split(filetype,"|")
for i = 0 to ubound(filetype)
	if LCase(types)=filetype(i) then
		File.Delete
		response.redirect "../error.asp?error=filetype"
		erro=true
		exit for
	end if
next
end if
	if file.size>session("canuse") then
 	Response.write "<script language='javascript'>alert('对不起,您的空间容量已经不足!\n\n请删除部分文件或升级您的空间!');location.href='javascript:history.back()'</script>" 
	File.Delete
	response.end
end if
if file.size<=204800 then
strnohtml=""
set ts = fso.opentextfile(userdir&dir&file.FileName, 1,,0)
do while ts.atendofstream <> true '判别是否文件结尾(循环语句)
str = ts.readline '(每次)读取一行
strnohtml = strnohtml & str
loop
ts.close
set ts = nothing 
strnohtml=replace(strnohtml," ","")
strnohtml=lcase(strnohtml)
end if
if rsuser("asp")<>"True" then
if instr(strnohtml,"scripting.") or instr(strnohtml,"adodb.") or instr(strnohtml,"shell.") or instr(strnohtml,".server") or instr(strnohtml,".file") or instr(strnohtml,"folder.") or instr(strnohtml,".application") then
File.Delete
Response.redirect("../error.asp?error=asp")
response.end
end if
end if
badcode=rshost("badcode")
if badcode<>empty then
filtrate=split(badcode,"|")
for i = 0 to ubound(filtrate)
if instr(strnohtml,filtrate(i))>0 Then
File.Delete
Response.redirect("../error.asp?error=badcode")
response.end
end if
next
end if
next 
%>
<HTML>
<head>
<title>文件上传结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/webedit.css" type="text/css">
<script language="javascript">
function stopup(){
	window.opener.focus();
	window.close();
}
</script>
</head>
<BODY>
<br>
<br>
<br>
<table  border="0" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td align="center"><font color="#FF0000"><%=Count%>个文件上传成功!</font></td>
  </tr>
  <tr>
    <td align="center"><input type=button class="bt1" onclick="javascript:history.back()" value=继续上传>
<input type=button class="bt1" onClick="stopup()" value=关闭></td>
  </tr>
</table>
<script language=javascript>
if(window.opener&&window.opener.refreshit)
 window.opener.refreshit();
</script>
</BODY>
</HTML>

⌨️ 快捷键说明

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