/**
  * Before validation callback
  *
  * Check if the file is really an uploaded file and run custom checks for file 
  * extensions and / or mime type if configured to do so.
  *
  * @param Model $Model
  * @param array $options
  * @return boolean True on success
  */
 public function beforeValidate(Model $Model, $options = array())
 {
     extract($this->settings[$Model->alias]);
     if ($validate === true && isset($Model->data[$Model->alias][$fileField]) && is_array($Model->data[$Model->alias][$fileField])) {
         if ($Model->validateUploadError($Model->data[$Model->alias][$fileField]['error']) === false) {
             $Model->validationErrors[$fileField] = array($this->uploadError);
             return false;
         }
         if (!empty($Model->data[$Model->alias][$fileField])) {
             if (empty($localFile) && !is_uploaded_file($Model->data[$Model->alias][$fileField]['tmp_name'])) {
                 $this->uploadError = __d('file_storage', 'The uploaded file is no valid upload.');
                 $Model->invalidate($fileField, $this->uploadError);
                 return false;
             }
         }
         if (is_array($allowedMime)) {
             if (!$this->validateAllowedMimeTypes($Model, $allowedMime)) {
                 return false;
             }
         }
         if (is_array($allowedExtensions)) {
             if (!$this->validateUploadExtension($Model, $allowedExtensions)) {
                 return false;
             }
         }
     }
     return true;
 }