$Id: FileUploader.jsp,v 1.8 2009/08/07 23:44:08 asyhuang Exp $
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
locale="<%=((com.sun.identity.console.base.AMViewBeanBase) viewBean).getUserLocale()%>"/>
<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2008" fireDisplayEvents="false">
<script language="javascript" src="../console/js/am.js">
var failUpload = "<cc:text name="txtConfigured" defaultValue="ajax.upload.file.failed" bundleID="amConsole" escape="false" />";
var closeBtn = '<p> </p><p><div class="TtlBtnDiv"><input name="btnClose" type="submit" class="Btn1" value="<cc:text name="txtCloseBtn" defaultValue="ajax.close.button" bundleID="amConsole" />" onClick="focusMain();return false;" /></div></p>';
var idoc = document.getElementById('fileupload');
var dataDiv = idoc.contentWindow.document.getElementById('data');
data = dataDiv.innerHTML;
data = data.replace(/^\s+/, '');
data = data.replace(/\s+$/, '');
data = data.replace(/</g, '<');
data = data.replace(/>/g, '>');
if (data.length == 0) {
document.getElementById('dlg').innerHTML = '<center>' +
} else if(data.search("Error:") == 0){
var msg = data.substring(7);
msg = errorUpload.replace("{0}", msg);
document.getElementById('dlg').innerHTML = '<center>' +
var fldName = window.name;
var idx = fldName.indexOf('_');
labelName = fldName.substring(idx+1);
fldName = fldName.substring(0, idx);
var idx = labelName.indexOf('_');
methodName = labelName.substring(idx+1);
labelName = labelName.substring(0, idx);
var parent = opener.document.forms[0];
field.value = data + '<!-- ' + escapeHtml(filename) + ' -->';
var labelWidget = opener.document.getElementById(labelName);
if (labelWidget.innerText) {
labelWidget.innerText = filename;
labelWidget.textContent = filename;
self.close();
var tn = document.createTextNode(unsafe);
var p = document.createElement('p');
p.appendChild(tn);
return p.innerHTML;
<div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width:auto; height:101%;">
<form name="FileUploader" action="../console/ajax/FileUpload.jsp"
enctype="multipart/form-data" method="post" target="fileupload" onSubmit="filename=this.elements['fileX'].value;">
pageTitleText="file.uploader.title"
<iframe style="display:none" src="about:blank" id="fileupload" name="fileupload" onload="selectFile(this.contentWindow.document);"></iframe>