This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Validating file extension problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Validating file extension problem" Watch "Validating file extension problem" New topic

Validating file extension problem

siddharth paul

Joined: Apr 30, 2008
Posts: 20
hii all
in my code i m uploading a file with .doc extension
its working fine and giving alert when extension is not .doc but the problem is when it is different file extension, after the alert it is not clearing the field.
siddharth paul

Joined: Apr 30, 2008
Posts: 20
using reset as a solution will reset the whole page but i want only file field to be reset.
what are the security restriction for resetting a file field.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You can not set the value of the field since it is a security concern.

You can try ext.reset() and see if that works, I am guessing that it will not.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Validating file extension problem
It's not a secret anymore!