The file extension

@return string
187831
public function getExtension()
    {
        if (!isset($this->file['name'])) {
            return null;
        }

        $extension = pathinfo(
            $this->file['name'],
            PATHINFO_EXTENSION
        );

        return strtolower($extension);
    }
154565
public function get_extension(){
    parent::get_extension();
		if ( !$this->ext2 && $this->file ){
			if ( function_exists('exif_imagetype') ){
				if ( $r = exif_imagetype($this->file) ){
          if ( !array_key_exists($r, bbn\file\image::$allowed_extensions) ){
            $this->ext = false;
          }
				}
				else{
          $this->ext = false;
        }
			}
			if ( $this->ext ){
				$this->ext2 = $this->ext;
				if ( $this->ext2 === 'jpg' ){
          $this->ext2 = 'jpeg';
        }
			}
		}
		return $this->ext;
	}
1068776
public function get_extension()
  {
    if ( $this->name ){
      if ( !isset($this->ext) ){
        if ( strpos($this->name, '.') !== false ){
          $p = str::file_ext($this->name, 1);
          $this->ext = $p[1];
          $this->title = $p[0];
        }
        else{
          $this->ext = '';
          $this->title = substr($this->name,-1) === '/' ? substr($this->name,0,-1) : $this->name;
        }
      }
      return $this->ext;
    }
    return false;
  }
1145874
public function getOutfile()
    {
        if ($this->outfile) {
            return $this->outfile;
        } else {
            return $this->formatter->getPreferredOutfile() . $this->getExtension();
        }
    }
877040
public function upload() : string
    {
        if (!$this->_validateUpload()) {
            return '';
        }

        $result = $this->_uploadFile();

        if ('' === $result) {
            $this->flash->error('Unable to upload file to the specified directory.');
        }

        return $result;
    }
409601
public function getFilePath() : ?string 
    {
        if ( ! $this->hasFilePath()) {
            $this->setFilePath($this->getDefaultFilePath());
        }
        return $this->filePath;
    }
510733
public function generateFilename()
    {
        $filename = $this->label().' '.date('Y-m-d H-i-s');
        $extension = $this->generateExtension();

        if ($extension) {
            return $filename.'.'.$extension;
        } else {
            return $filename;
        }
    }
880895
public function getSafeFileName()
    {
        $fileExtension = pathinfo($this->file->getClientOriginalName(), PATHINFO_EXTENSION);
        $mimeTypeExtension = $this->file->guessExtension();
        $newExtension = !empty($mimeTypeExtension) ? $mimeTypeExtension : $fileExtension;

        $baseName = !empty($fileExtension) ? basename($this->file->getClientOriginalName(), $fileExtension) : $this->file->getClientOriginalName();
        $safeBaseName = Transliterator::urlize($baseName);

        return $safeBaseName . (!empty($newExtension) ? '.' . $newExtension : '');
    }
978428
protected function getFileName(): string
    {
        if ($this->generatedFileName === null || Application::isCli()) {
            if ($this->fileNameFn !== null) {
                $this->generatedFileName = call_user_func($this->fileNameFn);
            } else {
                $this->generatedFileName = gmdate('Y-m-d') . '.log';
            }
        }

        return $this->generatedFileName;
    }
1202746
public function getNameWithExtension()
    {
        return $this->extension === '' ? $this->name : sprintf('%s.%s', $this->name, $this->extension);
    }
1086577
public function getExtension()
    {
        $pos = strrpos($this->name, '.');
        if ($pos === false) {
            return null;
        } else {
            return substr($this->name, $pos + 1);
        }
    }
194174
public function getDisplayName()
	{
		if (isset($this->filename))
		{
			// If it is a dotfile the filename is '' and the extension will be the rest of the filename
			if ($this->filename == '' && isset($this->extension))
			{
				return '.' . $this->extension;
			}
			return $this->filename;
		}

		if (isset($this->basename))
		{
			return $this->basename;
		}

		if (isset($this->path))
		{
			$bits = explode('/', $this->path);
			return end($bits);
		}

		return '';
	}
499713
public static function _getExtension ($file)
	{
		
		// Get Extension
		
		$base	= basename ($file);
		$arr	= explode ('.', $base);
		$ext	= strtolower (array_pop ($arr));
		
		// Return the extension
		
		return $ext;
		
	}
1261048
public function fileMimeType()
    {
        try {
            $mimeType = $this->storage->mimeType($this->blob->path);
        } catch (\Exception $ex) {
            $ext = pathinfo($this->blob->path, PATHINFO_EXTENSION);
            $mimeType = BlobMetadata::guessMimeType($ext, !!$ext);
        }

        return $mimeType;
    }
89487
public function fileatime()
	{
		if ($this->use_include_path) {
			return fileatime(stream_resolve_include_path($this->_fhandle));
		} else {
			return fileatime($this->_fhandle);
		}
	}
293487
public function getLength()
	{
		if (is_null($this->length)) {
			$this->length = filesize($this->path);
		}
		return $this->length;
	}
186100
public function getFileInfo()
    {
        $ret = array(
            'uploadId' => $this->id,
            'mimeType' => $this->mime_type,
            'filename' => $this->filename,
            'extension'=> $this->extension,
            'fileSize' => $this->getFileSize(),
            'hashKey'  => $this->getHashKey()
        );
        if (!$this->id && is_file($this->filename)) {
            $ret['mimeType'] = $this->_getMimeType($this->filename);
            $ret['extension'] = substr(strrchr($this->filename, '.'), 1);
        }
        $size = $this->getImageDimensions();
        if ($size) {
            $ret['image'] = true;
            $ret['imageHandyScaleFactor'] = Kwf_Media_Image::getHandyScaleFactor($size);
            if (abs($size['rotation']) == 90) {
                $size = array('width'=>$size['height'], 'height'=>$size['width']);
            }
            $ret['imageWidth'] = $size['width'];
            $ret['imageHeight'] = $size['height'];
        } else {
            $ret['image'] = false;
        }
        return $ret;
    }