title: Validate file extension and size before submitting form
body: <p>I am using jQuery validate plugin, and want to validate file extension and file size before submitting a form.</p>
  
  <pre><code>"use strict";
  $('#update_profile').validate({
      rules: {
          FirstName: {
              required: true,
              maxlength: 20
          },
          image: {
              required: true,
              extension: "jep | jpeg",
              filesize : 50000,
          }
      }
  });
  </code></pre>
  
  <p>I want code similar to the above.</p>