html5 - What is the Javascript Equivalent of A User Clicking on the Input Type File Button? -


what need programmatically hook file select dialog created when user clicks on button input type file, without user clicking on button. javascript test if file exists, , handle needed: read it, copy it, etc.

try utilizing onchange event access file object if user selects file ; js cannot select user file .

var input = document.queryselector("[type=file]");    input.onchange = function() {    console.log(this.files)  }
<input type="file" />


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -