jquery

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.

Was this helpful?