• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts uplaod file

 
shabarish vai
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi , m using struts to upload the file i want to restrict the uploaded file, like the uploaded file should not contain any special characters like
!@#$%^&*.. if it contains it has to throw an validation message.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33723
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shabarish,
I think you would need to add some logic to your action to validate this.
 
shabarish vai
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Shabarish,
I think you would need to add some logic to your action to validate this.


hi , m using struts to upload the file i want to restrict the uploaded file, like the uploaded file should not contain any special characters like
!@#$%^&*.. if it contains it has to throw an validation message

please explain me wit small code as am new to struts

thanks
Shabarish
 
Dhinesh Rajendran
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

if you want to check the name of file then check it before submitting the action by Java Script.If You want to check the content of the file then you have to check in the Action class while reading/getting the content of the file .
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic