Hi,
I've found a work around for the following problem:
RadUpload is unable to set the width of the file select boxes in Mozilla/Firefox due to a browser bug. More information is available in Modifying File Input Appearance.
An easy way to fix this is in the CSS. Following are the two styles used for the input (taken from the Default skin)
| .RadUploadInputField |
| { |
| width: 140px; |
| border: solid 1px #cfcfcf; |
| background: white; |
| border-right: 0px; |
| vertical-align: top; |
| height: 17px; |
| _width: 150px; |
| } |
| |
| input.RealFileInput |
| { |
| position: relative; |
| -moz-opacity: 0; |
| filter: alpha(opacity: 0); |
| opacity: 0; |
| z-index: 2; |
| } |
| |
| |
I've modified it as follows to get a width that is greater than the usual 140px
| .RadUploadInputField |
| { |
| width: 370px; |
| border: solid 1px #cfcfcf; |
| background: white; |
| border-right: 0px; |
| vertical-align: top; |
| height: 17px; |
| _width: 440px; |
| } |
| |
| input.RealFileInput |
| { |
| width: 440px; |
| -moz-opacity: 0; |
| filter: alpha(opacity: 0); |
| opacity: 0; |
| position: relative; |
| z-index: 2; |
| text-align:right; |
| } |
| |
I'm aiming for a width of 440px. Now note the "width" on the RadUploadInputField style. It's 370px which is 440px - select button width. Also note the width on the input.RealFileInput style. It's at 440px, the width I'm aiming for. Also note the text-align:right this does the final fix. You'll also have to increase the width in the RadUploadTable style to compensate for the new upload input width.
So to get it working all you need do is the following:
- Set the width in the RadUploadInputField style to:
YourDesiredWidth - SelectButtonWidth
- Set the width on the input.RealFileInput to YourDesiredWidth
- Add the text-align:right attribute to the input.RealFileInput style
- Increase the width in the RadUploadTable style to compensate for your new upload input width.
Cheers,
Michael