Using jQuery files[].size function - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Using jQuery files[].size function

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> 
  <script type="text/javascript">
    window.onload=function(){/* w ww. ja va 2s. co m*/
$(function() {
  $('#fileUpload').bind('change', function() {
    console.log(this.files[0].size);
  });
})
    }

      </script> 
 </head> 
 <body> 
  <input type="file" id="fileUpload">  
 </body>
</html>

Related Tutorials