How to get “value” of file upload input field in jquery?

Web Development

Is it possible to determine if the user has selected a file for a particular input type="file" field using javascript/jQuery?



Ans: Yes, the value can be read and bind to the change event if you wish.



  <title>Demo Page</title>

  <script src=""></script>

  <script type="text/javascript">



    $('#tester').change( function()


      console.log( $(this).val() );






<input type="file" id="tester" />




If you want to unleash your potential in this competitive field, please visit the Web Development course page for more information, where you can find the Web Development tutorials and Web Development frequently asked interview questions and answers as well.


This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.
Protected by Astra Security