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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -