tags:

views:

460

answers:

1
+1  Q: 

file upload in JSF

I am using tomahawk 1.1.9 fileupload component t:inputFileUpload

It displays a placeholder for the file that gets uploaded and a button that has label "Browse".

I want to hide that Place holder and want to give my own label to the button instead of "Browse".

+1  A: 

I don't think this is going to be possible without some fairly ugly CSS hacking. The file input box is there for a good reason: security. If it could be controlled (or removed) using JavaScript, users could potentially have sensitive files uploaded without their knowledge or consent.

The input file box is a way of them having some confidence that what they are uploading is only the file they actually want to upload.

The only thing I have seen done successfully with input file boxes is styling them - have a look at this and this for examples.

Phill Sacre
Thanks for your reply. I have seen the link. But I need to use only JSF tag not html. And my requirement is to display only Button. Is there any other tag which can accomplish this.I can use rich faces component also.
Isha Dubey
Then just do so. They have a file upload component as well: http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf
BalusC
Hi BalusC, Thanks for ur reply....am using richFaces 3.1.6 But in this version there is no rich:fileupload component.What should i do?
Isha Dubey
is there any way to change the label of fileupload component button "Browse" to label of our own and to hide the place holder of file upload component of tomahawk 1.1.9..... Also, is there any component for file upload in richfaces 3.1.6...
Isha Dubey
Either upgrade richfaces, or create a custom component.
BalusC
Thanks for your reply...How to create custom component?
Isha Dubey