/ Published in: jQuery
File size validation
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * * Function to validate File size * **/ function findSize(field_id) { var fileInput = $("#"+field_id)[0]; byteSize = fileInput.files[0].fileSize; return ( Math.ceil(byteSize / 1024) ); // Size returned in KB. }