An Opera bug: auto triggering the browse input when a text link is clicked
following up on this question I made before, I just found out that it does not work on Opera!
How do I fix it?
Here is开发者_开发知识库 the link for testing.
it seems like due to security policies triggering click on the input type=file
is not allowed/supported in some browsers and opera is one of them
see this answer input type file in Opera
You can not trigger a file dialog from JavaScript in Opera. I'm somewhat surprised if other browsers allow this..
It is still possible to do what you want by placing an invisible file input on top of your text link. To make it invisible, you can for example style it with opacity:0
. This way, the users will get the impression that they are clicking a text link while the click will actually hit the file input and trigger the file dialog.
精彩评论