aspose file tools*
The moose likes Struts and the fly likes struts uplaod file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts uplaod file" Watch "struts uplaod file" New topic
Author

struts uplaod file

shabarish vai
Ranch Hand

Joined: May 26, 2008
Posts: 79
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

Joined: May 26, 2003
Posts: 30758
    
156

Shabarish,
I think you would need to add some logic to your action to validate this.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
shabarish vai
Ranch Hand

Joined: May 26, 2008
Posts: 79
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

Joined: May 27, 2008
Posts: 5
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 .
 
wood burning stoves
 
subject: struts uplaod file