This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how get the path for a file which has be uploaded  RSS feed

 
siva chowdary
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have <html:file property="file" name="ABCForm" size="43" tabindex="6" />

in jsp...it is working fine....but user can enter a the path from key board.How to validate the path which was entered by the user.I can't use getFile().getFileSize()<=0 because user can also upload empty files.I was trying to get the user entered file path in Validate()method.But i don't know how get that.I tried with getFile().getInputStream().It is not throwing the exception if the path is Invalide.Can any one provide solution how to validate the path
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.
The file input type allows the user to pick a file from their machine. For security reasons, the internals of that control are isolated from the page that it lives in.
You can not preset the value of a file field and you can not manipulate it's value with Javascript.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!