public function validate($value, phValidatable $errors)
 {
     if ($this->_required && $value === null) {
         $errors->addError($this->getError(self::REQUIRED));
         return;
     }
     if ($value === null) {
         return;
         // go no further, no file passed
     }
     $data = new phFileFormDataItem('parse');
     try {
         $data->bind($value);
     } catch (phFileDataException $e) {
         $errors->addError($this->getError(self::FILE_ERROR, array('%error%' => 'invalid file data')));
         return;
         // no point in going further, bad data
     }
     if ($this->_required && !file_exists($data->getTempFileName())) {
         $errors->addError($this->getError(self::REQUIRED));
         return;
     }
     if ($data->hasError()) {
         $errors->addError($this->getError(self::FILE_ERROR, array('%error%' => $data->getFileErrorString())));
         return;
         // no point in going further, bad data
     }
     if (sizeof($this->_mimeTypes) > 0 && !in_array($data->getMimeType(), $this->_mimeTypes)) {
         $validTypes = '';
         foreach ($this->_mimeTypes as $m) {
             $validTypes .= $m . ', ';
         }
         $errors->addError($this->getError(self::INVALID_MIME_TYPE, array('%types%' => substr($validTypes, 0, -2))));
         return;
     }
 }