com.jspsmart.upload捕获上传文件过大的异常:
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.setTotalMaxFileSize(1024*1024);
su.setAllowedFilesList( "JPG,jpg,bmp,BMP,gif,GIF ");
su.upload();
------解决方法--------------------------------------------------------
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.setAllowedFilesList( "JPG,jpg,bmp,BMP,gif,GIF ");
su.setTotalMaxFileSize(1024*1024);
try{
su.upload();
} catch(SecurityException e) {
if (e.getMessage().indexOf( "1110 ") > 0 || e.getMessage().indexOf( "1105 ") > 0) {
out.print( "文件的大小超过了1M! ");
}else {
out.print( "e.getMessage() ");
}
return;
}