Server can't receive an array of documents

View: New views
1 Messages — Rating Filter:   Alert me  

Server can't receive an array of documents

by zhanghaidang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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