File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: Validating file extension problem
It's not a secret anymore!