<script type = "text/javascript"> jQuery("input[type=file]").live("change", function(e){ e.preventDefault(); var file_size = jQuery(this)[0]; if(file_size.files[0].size > 2000000){ alert("File Size should be Maximum of 2 mb"); return false; } }); </script>
The above Script is simply adding a change event on file input type and check for Size of file input type and accordingly show alert message to user
I hope this simple script will help you, If any queries feel free to ask
No comments:
Post a Comment