title: How to validate file extension using jQuery validation engine
body: <p>I have tried the following code to validate a file that file type should be csv.</p>
  
  <pre><code>"validateMIME":  {
      "func": function(field, rules, i, options){     
      var fileInput = field[0].files[0];
      var MimeFilter = new RegExp(rules[3],'i');
      if (fileInput) {
          return MimeFilter.test(fileInput.type);
      } else { return true;}
    },
  "alertText": "* Only csv file is allowed."
  },
  </code></pre>
  
  <p>Firfox only works if use below code to validate</p>
  
  <pre><code>&lt;input type="file" name="csvfile" class="validate[required, custom[validateMIME[text/text/comma-separated-values]]]"&gt;
  </code></pre>
  
  <p>I tried the below code, no browser works</p>
  
  <pre><code>&lt;input type="file" name="csvfile" class="validate[required, custom[validateMIME[text/text/csv]]]"&gt;
  </code></pre>
  
  <p>Anyone suggest me whats wrong with my code?</p>