This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can validate input field file .

 
Chhaya Dhanani
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i ave been raking my head over this problem and don't seem to find a way.
I am using com.oreilly.servlet.MultipartRequest to upload files form a html page through file input type.
This allows me to type any non existent file name.
and then i genrate i jsp page which shows file upload succesful message.
How can i check where this file is a existent file ( i dont think i can check on the hard idsk from where it was uploaded..)
also how i can validate for the size of the file and show error message if this file is empty file.
please let me know client side javascript validations as well as server side validations..
Thanx in advance..
a real quick reply will be highly appreciated.!!


Chhaya
 
Raj Mohan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one way is, once you upload any file, this creates a file at server with file size 0. You have the filename at the serverside. Now check the file size of this filename at server side where it is being saving. if it is 0, then the file is not saved properly.
 
Chhaya Dhanani
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Raj.
That was the initial solution that me had thought of.
chhaya
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic