<%@  pagepageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils, java.util.*" %>

<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="DevResources"/>

<%   
JSPConduit c = JSPConduit.getJSPConduit(request);
//Properties resultStrings = (Properties) request.getAttribute("jspData");
//String fileString = (String) resultStrings.get("fileString");	
String fileString = c.var("fileString");
%>

<html>
<body style="border: 0px none;">
    
<script>
function uploadFile()
{
	document.uploadForm.submit();
}

function onInit()
{ 
    top.changeValue("<%= fileString %>");
}

</script>
<%
if(fileString != null && fileString.length() > 0)
{
  //we need to change the values in the parent
  %>
  	<script>
    	top.changeValue("<%= fileString %>");
  	</script>
  <%
  
}
%>
<form name="uploadForm" id="uploadForm" action="/nps/servlet/webacc?Autoparse=true&taskId=fw.OctetStringUpload&merge=fw.OctetStringExchanger&error=fw.OctetStringExchanger" method="post" enctype="multipart/form-data">
    <TABLE>
    <TR>
    	<TD>
         	   <input type="file" name="myfile" id="myfile" size="45"/>
         	   <input type="button" name="uploadButton" value="<iman:string key='File.FileUpload'/>" onclick="uploadFile()">
        </TD>
    </TR>
   </TABLE>
 </form>
  
  </body>
  </html>