Why does file_validate_extensions fail to validate?
$form['#attributes']['enctype'] = 'multipart/form-data';
$form['survey']['file-upload'] = array(
  '#type' =&gt; 'file',
  '#prefix' =&gt; '&lt;div class="survey-file-upload"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;&lt;/div&gt;',
  '#description' =&gt; 'Image type PNG/JPG Max Size:2Mb.',
);

function create_survey_form_validate($form, &amp;$form_state){
$save = file_save_upload('file-upload', array('file_validate_extensions' =&gt; array("jpg png")),"public://user_sheets",FILE_EXISTS_RENAME);
  if($save == null){
    form_set_error('file_upload', 'Please select a file');
  }
  else if($save == FALSE){
   form_set_error('file_upload', 'Error in file upload');
  }
}