title: Only allow certain files types to be added during an upload
body: <p>All,
  I'm using the following code to upload some images to my Wordpress blog:</p>
  
  <pre><code>$fieldname = 'logo';
  include_once(ABSPATH . 'wp-admin/includes/media.php');
  include_once(ABSPATH . 'wp-admin/includes/file.php');
  
  if ($_FILES[$fieldname]) {
      $overrides = array('test_form' =&gt; false); 
      $file = wp_handle_upload($_FILES[$fieldname], $overrides);
      echo $file[error];
  }
  </code></pre>
  
  <p>This works fine, however I can upload any type of file and as you are aware that could be potentially dangerous. Is there a way to make sure that the file is only a .jpg, .jpeg, .gif or a .png in the overrides or something like that?? Any help would be greatly appreciated!</p>
  
  <p>Thanks!</p>