<!--#include file="CONN.ASP"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_huayuweb()^191563631.asp"-->
<!--#include file="cls_filemanagehycs.asp"-->
<!--#include file="cls_upfilehycmscs.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
if oa.chkadmined=false and oa.chklogin=false then
oa.msgclose("您没有登陆或登陆超时!请不要非法操作!")
end if

if request("action")="del" then
delfile
end if
if request.QueryString("act")="upload" then
uppath=request("filepath")
FormName=request("FormName")
EditName=request("EditName")
 Dim Upload,path,tempCls,fName,uppath
'===============================================================================
 set Upload=new AnUpLoad
 		 				'创建类实例
 Upload.SingleSize=1024*1024*1024*1024           			'设置单个文件最大上传限制,按字节计；默认为不限制
 Upload.MaxSize=1024*1024*1024*1024            				'设置最大上传限制,按字节计；默认为不限制
 Upload.Exe="jpg|gif|swf|rar|doc|xls|txt|bmp|png|wma|ppt|wmv|flv"          				'设置合法扩展名,以|分割,忽略大小写
 Upload.Charset="gb2312"								'设置文本编码，默认为gb2312
 Upload.openProcesser=false								'禁止进度条功能，如果启用，需配合客户端程序
 Upload.GetData()
 	
									'获取并保存数据,必须调用本方法
'===============================================================================
 if Upload.ErrorID>0 then								'判断错误号,如果myupload.Err<=0表示正常
 	response.write Upload.Description 					'如果出现错误,获取错误描述
 else
 	if Upload.files(-1).count>0 then 
						'这里判断你是否选择了文件
    		path=server.mappath("../"&uppath) 				'文件保存路径(这里是files文件夹)
    		'保存文件(以新文件名保存)
    		set tempCls=Upload.files("file1") 
    		tempCls.SaveToFile path,0
    	    fName=tempCls.FileName
    		set tempCls=nothing
	
    else
		response.Write "您没有上传任何文件！"
 	end if
 end if
 set Upload=nothing%>
<script type ="text/javascript">
	window.opener.document.<%=FormName%>.<%=EditName%>.value='<%=uppath%><%=fName%>';
	alert("文件上传成功.");
		window.opener =null;
	window.close();
      </script>
 <%end if
sub delfile

dim file,filepath
set file= new filemanage
filepath=trim(webdir&request("filepath"))
if filepath<>"" then
filepath=server.MapPath(filepath)
else
response.write ("<script>alert('您还没有上传文件！请先上传文件');window.close()</script>")
end if
if file.Checkfile(filepath) then
file.deletefile filepath
end if
response.write "<script>alert('删除成功');window.opener.document."&request("FormName")&"."&request("EditName")&".value='';window.close()</script>"
response.end()
end sub



%>