This question is fundamentally different from Programmatically trigger “select file” dialog box because the latter involves User Action on DOM elements. The question here is how to trigger an input file without user action...
So as I was working on my AngularJS project, I noticed a peculiarity of the file input field... I have it with visibility hidden on my page and generally triggered it with the JQuery trigger function ($("#random").trigger('click')) when the user clicked on other DOM elements.
Now, there is a peculiar instance when I want to open it automatically on page load after retrieving some data from the servers.. more as a shortcut for the user's sake, once the page has only that purpose in mind. So after receiving the callback results, I trigger it with the same JQuery trigger function. But it does not work.
So.. I figure it is only possible to trigger a file input by clicking programmatically/manually on another DOM element but not by solely programmable means?
Is this some browser security restriction or does someone have a workaround? I have tried a little bit of everything, including Timeouts...
Not that I REALLY need this functionality, actually it would be less 'spammy' w/out it, but more as a professional curiosity on the matter.
Cheers.
M