Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-10-2008, 12:05 PM
Member
 
Join Date: Jun 2008
Posts: 1
call_sreenu is on a distinguished road
upload file validations
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to upload a file? tommy JavaServer Pages (JSP) and JSTL 4 06-30-2008 04:50 PM
Simple way to upload file via FTP? Hiro ZA New To Java 0 03-27-2008 03:27 PM
Applet File Upload genette Java Applets 2 03-09-2008 04:06 PM
File Upload ShoeNinja JavaServer Pages (JSP) and JSTL 0 11-10-2007 12:09 AM
how to upload a file using servlet simon Java Servlet 1 08-05-2007 05:50 AM


All times are GMT +3. The time now is 03:01 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org