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

📄 admin_loaddown_updo.asp

📁 小说站源代码文件
💻 ASP
字号:
<!-- #include file="../conn.asp" -->
<!--#include file="../inc/config.asp"-->
<!-- #include file="session.asp" -->
<!--#include file="../inc/upload.inc"-->
<!--#include file="../inc/upfile.asp"-->
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="load.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
Server.ScriptTimeOut=48000 '设定操作超时的时间(因为程序运行速度慢啊)
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
cndb=request.querystring("cndb")
set rs2=server.CreateObject("ADODB.recordset")
sql2="select list_name from list_book where id="&id&" ORDER BY id"
rs2.open sql2,conn,1,1
if rs2.eof and rs2.bof then
	Call ShowAdminErrMsg("<li>作品不存在!</li><br>","javascript:window.close();")
	response.end 
else
	list_name=rs2("list_name")
end if
rs2.close
set rs2=nothing
if WebAllowFile=0 then
	Call ShowAdminErrMsg("<li>系统禁止上传</li><br>","javascript:window.close();")
	response.end
elseif WebAllowFile=1 then
	Select Case request.querystring("info")
		Case "ALLTXT"
			Call ALLTXT()
		Case "listrar"
			Call listrar()
		Case "listjar"
			Call listjar()
		Case "listumd"
			Call listumd()
	end select 
	Sub ALLTXT()
	set upload=new upload_cnendweb
		formPath=SiteSystemPath&"booktext/"
		formName=upload.form("file1")
		set file=upload.file("file1")		'获取文件
		if file.filesize<10 then		'判断文件大小
			ErrCodes = ErrCodes & "<li>您要上传的文件过小或不存在,请选择你要上传的文件!</li><br>"
			FoundErr=True
		end if
		fileExt=lcase(right(file.filename,4))	'提取文件后缀
		uploadsuc=false
		if fileEXT=".txt" then
			uploadsuc=true
		else
			uploadsuc=false
		end if
		if uploadsuc=false then			'判断文件格式
			ErrCodes = ErrCodes & "<li>您要上传的文件格式不正确!</li><br>"
			FoundErr=True
		end if
		filename=id&fileExt
		if FoundErr=True then
			Call ShowAdminErrMsg(ErrCodes,"javascript:onclick=history.go(-1)")
		else
			if file.FileSize>0 then
				if TrueStr(FileName)=false then
				    Call ShowAdminErrMsg("<li>非法文件</li><br>","javascript:onclick=history.go(-1)")
				    response.end
				end if
				file.SaveAs Server.mappath(formPath&FileName)
			end if
			response.write ("<script>opener.location.reload();</script>")
			Call ShowAdminSuccessMsg("<li>作品 "&list_name&" 全文TXT上传结束!</li><br>","javascript:window.close();")
		end if
		set file=nothing
	set upload=nothing
	end sub

	Sub listrar()
	set upload=new upload_cnendweb
		formPath=SiteSystemPath&"uploadpath/"
		formName=upload.form("file1")
		set file=upload.file("file1")		'获取文件
		if file.filesize<10 then		'判断文件大小
			ErrCodes = ErrCodes & "<li>您要上传的文件过小或不存在,请选择你要上传的文件!</li><br>"
			FoundErr=True
		end if
		fileExt=lcase(right(file.filename,4))	'提取文件后缀
		uploadsuc=false
		if fileEXT=".rar" or fileEXT=".zip" then
			uploadsuc=true
		else
			uploadsuc=false
		end if
		if uploadsuc=false then			'判断文件格式
			ErrCodes = ErrCodes & "<li>您要上传的文件格式不正确!</li><br>"
			FoundErr=True
		end if
		filename=id&".rar"
		if FoundErr=True then
			Call ShowAdminErrMsg(ErrCodes,"javascript:onclick=history.go(-1)")
		else
			if file.FileSize>0 then
				if TrueStr(FileName)=false then
				    Call ShowAdminErrMsg("<li>非法文件</li><br>","javascript:onclick=history.go(-1)")
				    response.end
				end if
				file.SaveAs Server.mappath(formPath&FileName)
		 		conn.execute ("update list_book set list_rar='"&formPath&FileName&"' where id="&id)
			end if
			response.write ("<script>opener.location.reload();</script>")
			Call ShowAdminSuccessMsg("<li>作品 "&list_name&" ZIP/RAR压缩包上传结束!</li><br>","javascript:window.close();")
		end if
		set file=nothing
	set upload=nothing
	end sub

	Sub listjar()
	set upload=new upload_cnendweb
		formPath=SiteSystemPath&"uploadpath/"
		formName=upload.form("file1")
		set file=upload.file("file1")		'获取文件
		if file.filesize<10 then		'判断文件大小
			ErrCodes = ErrCodes & "<li>您要上传的文件过小或不存在,请选择你要上传的文件!</li><br>"
			FoundErr=True
		end if
		fileExt=lcase(right(file.filename,4))	'提取文件后缀
		uploadsuc=false
		if fileEXT=".jar" then
			uploadsuc=true
		else
			uploadsuc=false
		end if
		if uploadsuc=false then			'判断文件格式
			ErrCodes = ErrCodes & "<li>您要上传的文件格式不正确!</li><br>"
			FoundErr=True
		end if
		filename=id&fileExt
		if FoundErr=True then
			Call ShowAdminErrMsg(ErrCodes,"javascript:onclick=history.go(-1)")
		else
			if file.FileSize>0 then
				if TrueStr(FileName)=false then
				    Call ShowAdminErrMsg("<li>非法文件</li><br>","javascript:onclick=history.go(-1)")
				    response.end
				end if
				file.SaveAs Server.mappath(formPath&FileName)
		 		conn.execute ("update list_book set list_jar='"&formPath&FileName&"' where id="&id)
			end if
			response.write ("<script>opener.location.reload();</script>")
			Call ShowAdminSuccessMsg("<li>作品 "&list_name&" jar文件上传结束!</li><br>","javascript:window.close();")
		end if
		set file=nothing
	set upload=nothing
	end sub

	Sub listumd()
	set upload=new upload_cnendweb
		formPath=SiteSystemPath&"uploadpath/"
		formName=upload.form("file1")
		set file=upload.file("file1")		'获取文件
		if file.filesize<10 then		'判断文件大小
			ErrCodes = ErrCodes & "<li>您要上传的文件过小或不存在,请选择你要上传的文件!</li><br>"
			FoundErr=True
		end if
		fileExt=lcase(right(file.filename,4))	'提取文件后缀
		uploadsuc=false
		if fileEXT=".umd" then
			uploadsuc=true
		else
			uploadsuc=false
		end if
		if uploadsuc=false then			'判断文件格式
			ErrCodes = ErrCodes & "<li>您要上传的文件格式不正确!</li><br>"
			FoundErr=True
		end if
		filename=id&fileExt
		if FoundErr=True then
			Call ShowAdminErrMsg(ErrCodes,"javascript:onclick=history.go(-1)")
		else
			if file.FileSize>0 then
				if TrueStr(FileName)=false then
				    Call ShowAdminErrMsg("<li>非法文件</li><br>","javascript:onclick=history.go(-1)")
				    response.end
				end if
				file.SaveAs Server.mappath(formPath&FileName)
		 		conn.execute ("update list_book set list_umd='"&formPath&FileName&"' where id="&id)
			end if
			response.write ("<script>opener.location.reload();</script>")
			Call ShowAdminSuccessMsg("<li>作品 "&list_name&" umd文件上传结束!</li><br>","javascript:window.close();")
		end if
		set file=nothing
	set upload=nothing
	end sub
end if
%>
</body>
</html>

⌨️ 快捷键说明

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