title: jQuery File Upload - validate filesize and extension
body: <p>I'm using jQuery File Upload, my code is:</p>
  
  <pre><code>$(function(){
  
          var ul = $('#upload ul');
       // Initialize the jQuery File Upload plugin
          $('#upload').fileupload({
              maxFileSize: 500,
              acceptFileTypes:  /(\.|\/)(gif|jpe?g|png)$/i,
              formData: {
                  action: 'ja_upload_doc',
                  cv_id: $('#cv_id').val(),
                  first_name: $('#first_name').val(),
                  last_name: $('#last_name').val(),
              },
              // This element will accept file drag/drop uploading
              dropZone: $('#drop'),
  
              // This function is called when a file is added to the queue;
              // either via the browse button, or via drag/drop:
              add: function (e, data) {
  
                  // Automatically upload the file once it is added to the queue
                  var jqXHR = data.submit().success(function (result, textStatus, jqXHR) {
                      console.log('Done');
                 });
              },
  
              progress: function(e, data){
              },
              done:function(e, data){
  
                  console.log(data);
              },
              fail:function(e, data){
                  // Something has gone wrong!
                  data.context.addClass('error');
              }
  
          });
  
      });
  </code></pre>
  
  <p>I'm including</p>
  
  <ul>
  <li>jquery.ui.widget.js</li>
  <li>jquery.iframe-transport.js</li>
  <li>jquery.fileupload.js</li>
  <li>jquery.fileupload-ui.js</li>
  <li>jquery.fileupload.css</li>
  </ul>
  
  <p>Is there anything else I need to include to make the Validation work? Or is there something wrong with my code?</p>