jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes problem related to HTML file attribute 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 "problem related to HTML file attribute" Watch "problem related to HTML file attribute" New topic

problem related to HTML file attribute

Bk Jacky
Ranch Hand

Joined: Jun 11, 2005
Posts: 74
Hi Ranchers
I made a jsp file in which i am using HTML file attribute like
<input type=file name=dir>
Now when i click on this button it opens a window which shows various file inthat directory . i select a ".xsd" file.
But I want that window should show only files with ".xsd" extension. Not other files.So what i hav to do so.

SCJP1.4<br />SCWCD1.5<br />"Nothing is impossible"
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

You can add the accept attribute like accept="image/jpeg" but I am not 100% sure that all browsers support this. Be sure and check the file extension either in JavaScript and/or the server side code as well to be safe.

GenRocket - Experts at Building Test Data
I agree. Here's the link: http://aspose.com/file-tools
subject: problem related to HTML file attribute
It's not a secret anymore!