I am trying to get file name from input type='file' OnChange and after that. it is if giving length equal to 1
. But val()
is empty. How get file name here?
<span class="btn btn-primary fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>@(i18n_Models_Image.AddImages + "...")</span>
<input id="fileupload" type="file" name="files[]" accept="image/*">
</span>
$('#fileupload').on('change', function(e) {
console.log("hi");
console.log($('#fileupload').val()); // is empty
});