File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes customizing button image for file upload using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "customizing button image for file upload using struts " Watch "customizing button image for file upload using struts " New topic

customizing button image for file upload using struts

sai kinnera
Ranch Hand

Joined: Aug 12, 2004
Posts: 52
Anybody tried to give the customized "Browse" image for the file upload control using Struts. I am using FormFile object of the struts for uploading, which is not allowing me to attach my own "Browse" image. This is just to keep the uniform user interface, because I have some other "Browse" buttons in that page. Any help is very much appreciated.
sai kinnera
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
I have faced to this issue before. However, after several searching from the web, our conclusion is, we CANNOT customerize the Browse button if we make use of the tag <input type="file" ... >.

One article from Microsoft mentions that, in IE 4, we can use a gif as browse button. When this button is clicked, it invoke a JS to set the value of the file. However, this *property* is intentionally disabled in IE 5 and later versions due to the security issues. Netscape has disabled this feature as well. Thus, we have no way to customize the browse button.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
I agree. Here's the link:
subject: customizing button image for file upload using struts
It's not a secret anymore!