Posted By

erraja_07 on 07/12/11


Tagged

file size validation


Versions (?)

JQuery - Get Uploaded File size - File size validation


 / Published in: jQuery
 

File size validation

  1. /*
  2. *
  3. * Function to validate File size
  4. *
  5. **/
  6. function findSize(field_id)
  7. {
  8. var fileInput = $("#"+field_id)[0];
  9. byteSize = fileInput.files[0].fileSize;
  10. return ( Math.ceil(byteSize / 1024) ); // Size returned in KB.
  11. }

Report this snippet  

You need to login to post a comment.