<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Struts 2 Upload Multiple File</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
$(document).ready(function() {
    $('#addMoreFile').click(function() {
    	$('#uploadTable').append(
                '<tr><td><s:file label="Choose File to Upload" name="multipleFileUpload" theme="simple"/>'+
                '</td></tr>');
    	return false;
    });
     
});
</script>
<s:head />
</head>

<body>
	<h3 style="color: green">
		<s:text name="Struts 2 Upload Multiple File" />
	</h3>
	<s:form action="uploadMultipleFilesAction" namespace="/" method="post"
		name="strutsForm" enctype="multipart/form-data">
		
		<s:submit type="button" label="Add more files" id="addMoreFile"/>
			<table id="uploadTable" border="1">
				<tr><td><s:file label="Choose File to Upload" name="multipleFileUpload" theme="simple"/></td></tr>
			</table>
		<s:submit align="left" value="Upload All Files"/>

	</s:form>
</body>
</html>
