Chrome Extension

Get file from input type file jQuery

$('input[type="file"]').change(function(e) {
    var file = e.target.files[0];
});
Output
Return binary data of selected file that you can pass to your form data

If you want to get selected file form input type file in jQuery you can use the code snippet. Same in the javascript, you can pass event to 'onchange' event of input type file and get the selected file.

Search Index Data (The code snippet can also be found with below search text)

selected file from input[type="file"]
jQuery first file from file control
Was this helpful?
0 Comments
Never leave your website again in search of code snippets by installing our chrome extension.
Open Code Manager