hi ,
i want to validate FileAttachment If i give some junk data in IE7 It is not executing that page but it's working fine in IE6 And in IE6 & IE7 if i give more than 2MB,it is not enter inside the if loop ( if(attachmentFileName != null {...... }) at all .this is my code

if(attachmentFileName != null){
try{
InputStream inputStream = new FileInputStream(attachmentFileName);
if(attachmentFileName.length() > ApplicationDefs.TWO_MB){ addActionError("Sorry your file is size is greater than 2 MB");
return;
}
if(inputStream.available() == 0){
addActionError("Invalid file format");
return;
}
if(!isValidFileFormat(attachmentFileName)){
addActionError("Invalid file format");
return;
}

}catch(FileNotFoundException fne){
addActionError("Uploaded file not found");
return;
}catch(IOException io){
addActionError("Unable to read the uploaded file");
return;
}//end of try-catch
}//end of if

showing the following errors

15:36:47,339 ERROR [MultiPartRequest] org.apache.commons.fileupload.FileUploadBase$SizeL imitExceededException: the request was rejected because its size (2264141) exceeds the configured maximum (2097152)

15:36:52,839 ERROR [FileUploadInterceptor] the request was rejected because its size (2264141) exceeds the configured maximum (2097152)

please any body help me

sreenu