<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Video upload</title>

</head>

<body>


<div id="content_upload_video">

  <%

  //上传类型 
  //StoreSystemType page_Div_TagName_update_js SaveIoType Form_inputID

  request.getSession(true).setAttribute("StoreSystemType","cmsVideoUpload");

  //更新标签

  request.getSession(true).setAttribute("page_Div_TagName_update_js","msg");

  ////保存IO方式 ch Bytes Chars Buffer_Chars Buffer_String Apache_StreamsCopy

  request.getSession(true).setAttribute("SaveIoType","Apache_StreamsCopy");
//form input id

 request.getSession(true).setAttribute("Form_inputID","fileUPlaod_video");
 
  request.getSession(true).setAttribute("callbakFunction","setFilePathUPladed_Form_input");
 
  %>

<form id="fileUplaodForm" name="fileUplaodForm" action="/store/web/UploadFileWebStoreServlet" method="post" ENCTYPE="multipart/form-data" target="hidden_frame"  onsubmit="return subUplaodFileForm()">

  <p>视频：
      <input id="fileUPlaod_video" name="fileUPlaod_video" type="file" size="30" maxlength="255">
  </p>


  <p>

    <input type=submit value="上传"></input>
    </p>

     

</form>

   

<!-- -上传后，处理程序转到iframe     target="hidden_frame" target="_blank"  style="display:none"-->

<iframe name="hidden_frame"id="hidden_frame" style="display:none" ></iframe>

<!-- -显示消息 -->

<span id="msg"></span>  



<script language="javascript" src="/js/ajax.js"></script>

<script type="text/javascript">    
var upladoisok=false;

function subUplaodFileForm( ){
	var formUpload=document.forms["fileUplaodForm"];
	if(formUpload==null){
		alert("Not find uplaod form ,name: fileUplaodForm.");
	}else{
	
				//window.open("/storeFile/userUpload/uploadProcessorWindow.jsp");
		window.open('/storeFile/userUpload/uploadProcessorWindow.jsp','uplaodwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');


		formUpload.submit();
			
		return false;
	}

}

function setFilePathUPladed_Form_input(Form_inputID,fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById(Form_inputID);

	filePath.value=fileUploadedPath;

}    
function setFilePathUPladed(fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById("downFilePath");

	filePath.value=fileUploadedPath;

}   


// JavaScript Document
//案例
function update_send_report(){
	
var imServerLogined=false;
var xmlHttpIMLogin_send_report;
var rePort_send_SiteServer_url="/storeFile/userUpload/uploadPrpcessor_ajax.jsp";
var imAdminId=1;
if(imServerLogined==null||imServerLogined==false){
	//alert("login to im server by new user!");
	//缓存ajax
	xmlHttpIMLogin_send_report=GetXmlHttpObject(report_update_date_repaint);
	//http://192.168.0.99:8080/GsKeFuServer-war/gskeFuBean?uid=1&act=newUser
	var url=rePort_send_SiteServer_url;
	//alert(url);
	xmlHttpIMLogin_send_report.open("GET", url , false);
	xmlHttpIMLogin_send_report.send(null);
	
}
}//end fun
//获取ajax返回数据 重绘报表
function report_update_date_repaint(){
	var info;
	//Ajax必需先判定正确的状态后才取回返回的数据。"完成该操作所需的数据还不可使用"的错误
	//判断ajax程序状态
	if(xmlHttpIMLogin_send_report.readyState == 4) {
   		 if(xmlHttpIMLogin_send_report.status == 200) { 
   	 		info=xmlHttpIMLogin_send_report.responseText;
			//判断是否登录成功 is login sucess
			//alert(info);
	 var reportDiv=	document.getElementById("uploadProcessor");
	 reportDiv.innerHTML=info;
			
   	 }//END IF
    }//end if
	

}
</script>


</div>
<!-- end uplaod -->
</body>
</html>
