I have a form with file upload capabilities and I would like to be able to have some nice client side error reporting if the file the user is trying to upload is too big, is
Use below to check file's size and clear if it's greater,
$("input[type='file']").on("change", function () { if(this.files[0].size > 2000000) { alert("Please upload file less than 2MB. Thanks!!"); $(this).val(''); } });