<html>
<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
	<TITLE>File Upload</TITLE>
	<STYLE>
	div.uploadContainer{
		padding: 5px;
		margin:5px;
		border:1px solid #2A5685;
		background-color:#E7F4FA;
	}
	label.lblUpload{
		color:#2A5685;
		font-family:Helvetica,"Trebuchet MS",Verdana,sans-serif;
		font-size:14px;
		letter-spacing:-1px;
		line-height:20px;
	}
	</STYLE>
	<script>
	var isFileSelected=false;
	function check_for_file_selected(filename,submitId) {
		/* Check for whether the file is selected, otherwise disable the Submit/Upload Button */
		isFileSelected=filename.replace(/^\s+|\s+$/g,"")!=""?true:false;
		var btnUpload = document.getElementById(submitId);
		btnUpload.disabled = isFileSelected?false:true;
		return isFileSelected;
	}
	window.onunload = function(){
		if(isFileSelected){
			//window.opener.location.reload(true);
		}
	}
	</script>
</HEAD>
<body>
<div class="uploadContainer">
<form method="POST" action="/${url}" enctype="multipart/form-data">
<label class="lblUpload" >Select the file to attach:</label><br>
<input type="file" id="fileUpload" name="uploadedfile" onchange="check_for_file_selected(this.value,'btnUpload');" size="25">
<input type="submit" id="btnUpload" value="Upload" disabled="disabled">
</form>
</div>
</body>
</html>