yii\mongodb\file\ActiveRecord::extractFileName PHP Method

extractFileName() protected method

Extracts filename from given raw file value.
protected extractFileName ( mixed $file ) : string
$file mixed raw file value.
return string file name.
    protected function extractFileName($file)
    {
        if ($file instanceof UploadedFile) {
            return $file->tempName;
        } elseif (is_string($file)) {
            if (file_exists($file)) {
                return $file;
            } else {
                throw new InvalidParamException("File '{$file}' does not exist.");
            }
        } else {
            throw new InvalidParamException('Unsupported type of "file" attribute.');
        }
    }