• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can validate input field file .

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Raj.
That was the initial solution that me had thought of.
chhaya
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic