Friday, 1 July 2016

How to show file name in pop up when user selected a file

<!DOCTYPE html>
<html>
<body>

<input type="file" id="myFile" multiple size="50">


   
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">

    $(document).ready(function(){

        $('input[type="file"]').change(function(e){

            var fileName = e.target.files[0].name;

            alert('The file "' + fileName +  '" has been selected.');

        });

    });

</script>



</body>
</html>

No comments:

Post a Comment