I am using the inputFileUpload tag. I want to filter out displayed files.
Any help will be appreciated.
Thanks, Yasmin
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Use the 'accept' attribute. You're dependent on the web browser used though. Unfortunately almost all modern web browsers ignore it. Only Opera, which usually very strictly follows the w3 specs, uses it.
To get it to work in all web browsers, you can't go around embedding a Java Applet or Java Web Start Application (JNLP) in your JSF page. It runs entirely at the client side. This way you can just use for example the java.io.FileNameFilter to filter files.
That said, in the future please post JSF related questions at the JSF forum. You're talking about Tomahawk's t:inputFileUpload tag, which is a 3rd party JSF component which renders a HTML input type="file" element. It essentially has nothing to do with JSP as it is just a view technology. [ December 23, 2008: Message edited by: Bauke Scholtz ]
Bauke, Thank you for your response and sorry for posting a question that I thought was related to JSF.
Please allow me to rephrase my question. "Is there a way to filter out displayed files in JSF during file-upload?" I think your answer was no. Am I correct?
Thanks, Yasmin
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
There is a way, but not using JSF nor plain HTML.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
And sorry about my comment about the forum. I was under the impression that this topic was posted at the JSP forum. Either a moderator moved it without notification or I need new glasses.