I need to open the file download dialog by clicking on another button. I hide the file upload control (visibility: hidden) and when I press any other button I want to open this dialog. Below is the code I have:
<input type="file" style="visibility: hidden;" />
Below is javascript:
$('#button').click(function() { $('input[type=file]').click(); });
It works fine in Firefox 4 and IE8, but it doesn't work in chrome12, so the dialog doesn't open. Any idea why?
source share