This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Limiting File Size Upload  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1756
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the sommons-fileupload-1.2 jar

This is my code but a file with size of 889KB still gets uploaded.

Upload file size limit is set to .01 in my application settings.

 
Tim Moores
Saloon Keeper
Posts: 3755
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What *actual value* are you setting in the setFileSizeMax call? You might want to print it out, since the use of the config object -whatever that is- is a bit confusing.

As an aside, you might want to switch to the current version of the upload library; 1.2 is rather dated.
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!