Struts2:
JSP:
$(function(){
$('#upload').MultiFile({
max:5, STRING: {
remove:'Remover',
selected:'Selecionado: $file',
denied:'Invalido arquivo de tipo $ext!'
}
});
});
<form name="sendmail" enctype="multipart/form-data" id="sendmail" action="sendMail.action" method="post">
<input type="file" id="upload" name="upload'" />
<input type="submit"/>
</form>
Action:
public class SendMail extends ActionSupport {
private File[] upload;
private String[] uploadContentType;
private String[] uploadFileName;
get...()
set...()
public String execute() {
System.out.println(upload.length());
return INPUT;
}
}
Always show a length of only 1, Only get the first File