Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get size of a file using HTML 5

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 261
    Comment on it

    Hello Reader's! If you are looking for an HTML 5 validation which tell user the size of an file the code will help you:-

    In HTML fileL

    1. <input type="file" id="file" />

    In the JS file

    1. //binds to onchange event of your input field
    2. $('#file').bind('change', function() {
    3.  
    4. //this.files[0].size gets the size of your file.
    5. alert(this.files[0].size);
    6.  
    7. });

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: