Some statements made in foruns (see references):
The function must be part of a user activation such as a click event. Attempting to open the file dialog without user activation will fail.
A little example (for illustration only):
Notice the comments in the code.
Apparently the safest way to open an input file is create this element dynamically.
We also have the approach using
.trigger("click") (worked) and
.click() (did not work). I couldn't understand why trigger worked and click didn't, because apparently they do the same thing.
IMPORTANT: For me there is no guarantee that the "trigger" solution will continue to work in future versions of "Chrome" or even other "browsers" like "Firefox". That is why I think it is important to find a safe way to resolve this issue.