Is it possible to use uploadify to allow any user to select a file from the file dialogue and insert it into the file input element of a form? I only need to use uploadify as a way to style the "upload button" as an image.
I have tried other approaches here, here and here. All are not compatible with all browsers.
What else can I use / do to have my file input element as an image?
I would like to have my file input button to look consistent in all browsers.
Your best bet in that case would be to use a flash uploader. This would introduce a complete separate control and would have no dependency on the browser. There are plenty of them on the net. Here's one : http://swfupload.org/
I can't remember the source of the technique but this seems to be cross-browser. Tested in:
Here is the complete code:
HTML:
CSS:
The idea is to make the
<input type="file" />
transparent and place it on top of some style-able content (a<button>
in this case). When the end user clicks the button she will actually click the<input type="file" />
.If it's only the upload button you want to style, why can't you use CSS? That should work across all browsers.
If you put your code on jsFiddle, I can tell you more about what you can do.
The simple way to use a "label" tag and "for" property. Like this http://jsfiddle.net/Txrs6/ but in this case we don't see a chosen file. CODE
Another way with js http://jsfiddle.net/PZ5Ep/