<%@page contentType="text/html; charset=GBK"%><%@include file="../include/Admin.jsp"%><%@include file="../include/DBCon.jsp"%><%String isSerID="0",isUpPath=PathStr+UpPathStr+"flv/",isFilePath=UpPathStr+"flv/",isFileName="";int isFileStatus=0;if(!StrFormat.isNull(request.getParameter("act"))){if(StrFormat.isNum(request.getParameter("serid"))){isSerID=request.getParameter("serid");try{DBSql="select id,name,dir from ser where id="+isSerID;DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);if(DBRs.next()){isUpPath += DBRs.getString("dir")+"/";isFilePath += DBRs.getString("dir")+"/";if(!StrFormat.isNull(request.getParameter("filename"))){isFileName=request.getParameter("filename");}/**/GenUp GenUp=new GenUp();GenUp.setObjectPath(isUpPath);GenUp.setSize(UpSize);GenUp.setSuffix(UpExt);if(!StrFormat.isNull(isFileName)){GenUp.setName(isFileName);GenUp.setSourceFile(request,1);}else{GenUp.setSourceFile(request,0);isFileName=GenUp.getObjectFileName()[0];}isFileStatus=GenUp.getStatus()[0];/**/if(isFileStatus==0){out.print("<script type=\"text/javascript\">alert(\"上传成功！\");self.opener.form.flv.value = \""+isFileName+"\";self.opener.form.flv.disabled=true; self.opener.form.serid.value = \""+isSerID+"\";window.close();</script>");}else{out.print("<script type=\"text/javascript\">alert(\"上传失败！\");</script>");}}else{out.print("<script language=\"javascript\">alert(\"服务器错误！\");history.back();</script>");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}}else{out.print("<script language=\"javascript\">alert(\"请选择服务器！\");history.back();</script>");}}else{%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><meta name="keywords" content="向继根,Xiang Jigen,QQ,190582560"><meta name="description" content="Programmer:向继根 QQ:190582560 Email:190582560@qq.com"><meta name="author" content="向继根,Xiang Jigen" /><title><%=TitleStr%>上传文件</title><link rel="stylesheet" type="text/css" href="images/Style.css"/><script type="text/javascript" src="../js/min.js"></script><script type="text/javascript" src="../js/common.js"></script><script type="text/javascript" src="../js/css.js"></script><script type="text/javascript">function changeSrc(Obj){	var vlue = Obj.value;if(!vlue) return false;	var ext = vlue.substr(vlue.lastIndexOf('.')).toLowerCase();if(ext!='.flv' && ext!='.mp4'){alert('请上传格式为 .flv .mp4 的文件...');return false;}else{		document.getElementById('preview').src ='file:///' + vlue.replace('\\', '/');return true;}}function doUpFlv(){var serid = document.form.serid;var value = serid.options[serid.selectedIndex].value;document.form.action = "?act=do&serid="+value+"&filename=<%=request.getParameter("filename")%>";return true;}</script></head><body><form method="post" enctype="multipart/form-data" name="form" id="form" onSubmit="return doUpFlv();"><table cellpadding="0" cellspacing="1" class="table_list">	<caption>上传文件	</caption><tr><td>支持格式：【.flv .mp4】<br>建议大小：小于 <%=UpSize%> K </td></tr><tr><td>服 务 器：<select name="serid" id="serid"><%try{DBSql="select id,name from ser order by id asc";DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);while(DBRs.next()){out.println("<option value=\""+DBRs.getInt("id")+"\" >"+StrFormat.isNull(DBRs.getString("name"),"")+"</option>");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}%></select></td></tr><tr><td>文件地址：<input id="file" name="file" type="file" class="file_style" size="30" onChange="changeSrc(this);"></td></tr></table><div id="button"><input type="submit" name="dosubmit" class="button_style" value="上 传" />&nbsp;<input type="reset" name="reset" class="button_style" value="取 消" onClick="window.close();" /></div></form></body></html><%}%><%@include file="../include/DBConClose.jsp"%>