<!--#include file="admin_start.asp" -->
<!--#include file="admin_safe_files_include.asp"-->
<!--#include file="../inc/class_upload.asp"-->
<%
dim upload,file,formName,formPath,iCount,act,iFail
set upload=new upload_file

'MySys.error.info=upload.Version

if upload.form("filepath")="" then
	MySys.error.info="请输入要上传至的目录!"
	MySys.error.location="back"
	MySys.error.err
	set upload=nothing
	response.end
end if

formPath=upload.form("filepath")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"

act=procCheckDir(formpath,1)

if act<>"ok" then 
	MySys.error.info=act
	MySys.error.location="back"
	MySys.error.err
end if

iCount=0
iFail=0
for each formName in upload.file
	set file=upload.file(formName)
	if file.FileSize>0 then
		act=procCheckFile(file.FileName,0)
		if act="ok" then
			file.Savetofile Server.mappath(formPath&file.FileName)
			MySys.error.info=MySys.error.info+"·本地文件[ "+file.FilePath&file.FileName+" ]上传成功!"
			iCount=iCount+1
		else
			MySys.error.info=MySys.error.info+"·本地文件[ "+file.FilePath&file.FileName+" ]上传失败!"
			iFail=iFail+1
		end if
		MySys.error.info=MySys.error.info+"<br>·文件大小:"&file.FileSize
		MySys.error.info=MySys.error.info+"<br>·上传至:"&formPath&File.FileName&"<br>--------------------<br>"
	end if
	set file=nothing
next
set upload=nothing  ''删除此对象

MySys.error.info=MySys.error.info+"<br><div align=center><font size=2>"&iCount&"个文件上传成功! "&iFail&"个文件上传失败</font></font></div>"
MySys.error.location="back"
MySys.error.suc
%>
<!--#include file="admin_end.asp" -->
