<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%><%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test</title>
<link href="/com/goosaa/templete/default.css" type="text/css" rel="stylesheet">


</head>
<body>
<h1>存储系统测试</h1>

<%

	java.util.List<dao.StoreWebUserGrounpPermission> permissionList=service.entryService.StoreWebUserGrounpPermissionEntryService.getInstance()
		.getListAll();
		
		request.setAttribute("StoreWebUserGrounpPermissionList", permissionList);
%>

<div id="content">
上传权限:

<logic:iterate indexId="index" id="StoreWebUserGrounpPermissionItem" name="StoreWebUserGrounpPermissionList">
	<a href="/storeFile/test/selectpermission.jsp?pid=<bean:write name="StoreWebUserGrounpPermissionItem" property="id"/>">
	 <bean:write name="StoreWebUserGrounpPermissionItem" property="systemKeyWord"/>
	 
	 </a>
</logic:iterate>

</div>

<div id="content">
<form id="fileUplaodForm" name="fileUplaodForm" action="/store/web/UploadFileWebStoreServlet" method="post" ENCTYPE="multipart/form-data" target="hidden_frame"  onsubmit="return subUplaodFileForm()">
  <p>
    上传文件：<input name="fileUPlaod" type="file" size="60" maxlength="255">
    </input>
    </p>
	
	  <p>
    <input type=submit value="上传" size="16px">
    </input>
    
      </p>
	
	
  <p>
  <%
  
  	dao.StoreWebUserGrounpPermission  p=(	dao.StoreWebUserGrounpPermission )request.getSession(true).getAttribute("StoreWebUserGrounpPermissionTest");
	
		if(p!=null){
		  //上传类型 permission key 
  request.getSession(true).setAttribute("StoreSystemType",p.getSystemKeyWord());
		}else{
		  request.getSession(true).setAttribute("StoreSystemType","DonFileUpload");
		}

  //更新标签
  request.getSession(true).setAttribute("page_Div_TagName_update_js","div_msg_DonFileUpload");
  ////保存IO方式 ch Bytes Chars Buffer_Chars Buffer_String
  request.getSession(true).setAttribute("SaveIoType","Bytes");
  %>
  
  <logic:present name="StoreWebUserGrounpPermissionTest">
  上传权限关键字：<bean:write name="StoreWebUserGrounpPermissionTest" property="systemKeyWord"/>
  </logic:present>
  
    <logic:notPresent name="StoreWebUserGrounpPermissionTest">
   上传权限关键字： DonFileUpload
  </logic:notPresent>
  
   
   
    </p>
  
<p>
文件写入方式:Apache_StreamsCopy
<!--
<select name="SaveIoType">

<option value="Apache_StreamsCopy" selected="selected">Apache_StreamsCopy</option>
	<option value="ch">ch</option>
	<option value="Bytes">Bytes</option>
	<option value="Chars">Chars</option>
	<option value="Buffer_Chars">Buffer_Chars</option>
	<option value="Buffer_String">Buffer_String</option>
	<option value="FileOutputStream">FileOutputStream</option>

	
</select>
	-->
</p>
<!--
      <p>
      文件写入方式：ch <br/>
      如：ch Bytes Chars Buffer_Chars Buffer_String,部分文件需要不同IO方式。
	  
	  
      </p>
	  
	  -->
</form>

  

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

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

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

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




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

function subUplaodFileForm( ){
	var formUpload=document.forms["fileUplaodForm"];
	if(formUpload==null){
		alert("Not find uplaod form ,name: fileUplaodForm.");
		
		return false;
	}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(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;

}    

</script>


</div>


</body>
</html>