<!--#include file="../inchuayuwebrlzywzhyweb/CONN.ASP"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_huayuweb()^191563631.asp"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_showpage.asp"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_filemanagehycs.asp"--><!--#include file="hyweb()hycms()UpLoad_Class.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>上传文件</title>
<style type="text/css">
TABLE {margin-top:5px;}
TD{height:20px;padding:3px 0 0 5px;}
.head{background-color:#eeeeee;}
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style><script language="javascript">
<!--
// 是否有效的扩展名
function IsExt(url, opt){
	var sTemp;
	var b=false;
	var s=opt.toUpperCase().split("|");
	for (var i=0;i<s.length ;i++ ){
		sTemp=url.substr(url.length-s[i].length-1);
		sTemp=sTemp.toUpperCase();
		s[i]="."+s[i];
		if (s[i]==sTemp){
			b=true;
			break;
		}
	}
	return b;
}
var sAllowExt = "wma|wmv|flv|asf|avi|mp4|swf|mpeg|mpg";
// 检测上传表单
function CheckUploadForm() {
	if (!IsExt(document.upload.file1.value,sAllowExt)){
		alert("提示：\n\n请选择一个有效的文件，\n支持的格式有（"+sAllowExt+"）！");
		return false;
	}
	return true
}
-->
</script>
<link href="book.css" rel="stylesheet" type="text/css" />
</head>
<body style="font-size:12px;margin:0px;">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#6298E1">
  <tr>
    <td bgcolor="#6298E1"><div align="center" class="STYLE1">上传视频 </div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><%
	oa.chkadmin()
if request.QueryString("act")="upload" then
 Dim Upload,path,tempCls,fName
'===============================================================================
 set Upload=new AnUpLoad				 				'创建类实例
 Upload.SingleSize=1024*1024*1024*1024           			'设置单个文件最大上传限制,按字节计；默认为不限制
 Upload.MaxSize=1024*1024*1024*1024            				'设置最大上传限制,按字节计；默认为不限制
 Upload.Exe="wma|wmv|flv|asf|avi|mp4|swf|mpeg|mpg"          				'设置合法扩展名,以|分割,忽略大小写
 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("../upfile/video/") 				'文件保存路径(这里是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.myform.sppath.value='upfile/video/<%=fName%>';
	document.write("文件上传成功.");
		window.opener =null;
	window.close();
      </script>
      <%
 else
 %>
      <form action="upload_sp1_huayuweb.asp?act=upload" method="post" enctype="multipart/form-data" onSubmit="return CheckUploadForm()" name="upload" id="upload" style="margin:0px;padding:0px;" >
        <div align="center">文件选择：
          <input type ="file" name ="file1" />
          <br />
          <input name="submit" type ="submit" value="上传" />
        </div>
      </form>
    <%
 end if
%></td>
  </tr>
</table>
</body>
</html>

