www.gusucode.com > 25175 学生成绩管理查询系统码程序 > ADMIN/upprocess.asp

    <!--#include file="inc.asp"-->
<!--#include file="../config.asp"-->
<%
Call admin_log
Call admin_yz(3)

%>


<!--#include file="incupload.asp"-->
<script langugae="javascript"> 
<!-- 
parent.excel_info.location.href=parent.excel_info.location.href; 
--> 
</script> 

<%
set upload=new upload_5xsoft
if upload.form("act")="uploadfile" then
	filepath=cj_SystemFolder&"admin/excel"
	if left(filepath,1)<>"/" or instr(filepath,"\")>0 or instr(filepath,"*")>0 or instr(filepath,"?")>0 or instr(filepath,"'")>0 or instr(filepath,chr(34))>0 then
		response.write "<center><div style='width:350px;margin-top:10px;padding:3px 0;text-align:center;font-size:12px;color:#990000;border:solid 1px;border-color:#000090 #000090 #cccccc;background:#cccccc'>上传结果报告</div><div style='width:350px;padding:30px;font-size:12px;color:#000090;border:solid 1px;border-color:#000090 #000090 #cccccc;'>"
		response.write "对不起,没有填写路径或路径中含有非法字符<br><br>"
		response.write "<input type='button' style='width:65px;height:20px;font-size:12px' value='返回' onclick='window.history.go(-1)'></div>"&vbcrlf
		response.end
	end if
	if right(filepath,1)<>"/" then
		filepath=filepath&"/"
	end if

	basepath=Server.mappath(filepath)
	set obj_fso=server.createobject("scripting.filesystemobject")
	if not obj_fso.folderexists(basepath) then
		set obj_fso=nothing
		set upload=nothing
		response.write "<center><div style='width:350px;margin-top:10px;padding:3px 0;text-align:center;font-size:12px;color:#990000;border:solid 1px;border-color:#000090 #000090 #cccccc;background:#cccccc'>上传结果报告</div><div style='width:350px;padding:30px;font-size:12px;color:#000090;border:solid 1px;border-color:#000090 #000090 #cccccc;'>"
		response.write "对不起,目录“"&filepath&"”不存在,请先创建该目录!<br>"&vbcrlf
		response.write "<br><input type='button' style='width:65px;height:20px;font-size:12px' value='返回' onclick='window.history.go(-1)'></div>"
		response.end
	end If
function getname(s_string,s_clipchar)
	n_strpos=instrrev(s_string,s_clipchar)
	getname=lcase(right(s_string,len(s_string)-n_strpos))
end function
%>

<html>
<head>
<title>上传文件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
@import url("Admin_Style.css");
-->
</style>
</head>
<body onload="opener.window.location.reload()">
<center>
<div style="width:350px;margin-top:10px;padding:3px 0;text-align:center;font-size:12px;color:#990000;border:solid 1px;border-color:#000090 #000090 #cccccc;background:#cccccc">上传结果报告</div>
<div style="width:350px;padding:3px;font-size:12px;color:#000090;border:solid 1px;border-color:#000090 #000090 #cccccc;">
<%
	i=0
	for each formName in upload.objFile
		set file=upload.objFile(formName)
	file_type=getname(file.FileName,".")
	if file_type<>"xls" then
		set obj_fso=nothing
		set upload=nothing
		response.write "对不起,请上传正确的EXCEL文件!<br>"&vbcrlf
		response.write "<br><input type='button' style='width:65px;height:20px;font-size:12px' value='返回' onclick='window.history.go(-1)'></div>"
		response.end
	end if
		if file.FileSize>0 then
			file.SaveAs basepath&"\"&file.FileName
			response.write file.FileName&" ("&formatnumber(file.FileSize/1024,2,-1)&" K )  <br>上传至  "
			response.write filepath&file.FileName&"  成功!<br>"
			i=i+1
 		end if
		set file=nothing
	next
	set upload=nothing
	response.write "<b>共"&i&"个文件上传成功!</b><br>"
	response.write "<input type='button' style='width:65px;height:20px;font-size:12px' value='返回' onclick='window.history.go(-1)'></div>"&vbcrlf
	response.write "</body>"&vbcrlf
	response.write "</html>"&vbcrlf
else
	set upload=nothing
	response.redirect "fsoexplorer.asp?ntime="&ntime
end if
%>