From what I've been reading, opening a <input type="file"> file browse dialog through JavaScript has issues in some browsers. It appears that Firefox and Opera have the most problems with this. The typical recommendation I've seen is to put the <input type="file"> on top of your click element and set it's opacity to 0. Obviously that is not an ideal solution.
I have the code below:
<div style="position: absolute; overflow: hidden; width: 1px; height: 1px; opacity: 0;">
<input type="file" id="fileInput" name="files[]" multiple="multiple" />
</div>
<input type="button" value="Open" onclick="$('#fileInput').trigger('click')" />
I've tested this in IE8, Chrome (newer version), and Firefox (newer version). In all of these this code works fine.
I'm wondering, does anybody know which browsers this code will have problems with? I want to support IE8+ and all of the relatively newer versions of Chrome, Firefox, and Opera.