I\'m having two problems when trying to configure the Struts 2 File Upload Interceptor in my application. I want to change the parameter maximumSize
(the default va
First use validate method in your action file........
public void validate(){
if(getFileUpload() !=null){
System.out.println("======File size validation before upload: size in bytes: "+getFileUpload().length());
if(getFileUpload().length()>202400){
//Give the size in bytes whatever you want to take
addActionError("File is too large ! Select less than 200Kb file");
}else{
addActionMessage("File Uploaded successfully!");
}
}
}
For complete code,please visit http://knowledge-serve.blogspot.com/2011/10/upload-file-using-in-struts-2.html