TYPO3 CMS  TYPO3_8-7
TYPO3\CMS\Core\Type\File\FileInfo Class Reference
Inheritance diagram for TYPO3\CMS\Core\Type\File\FileInfo:
TYPO3\CMS\Core\Type\TypeInterface TYPO3\CMS\Core\Type\File\ImageInfo

Public Member Functions

 getMimeType ()
 
 getMimeExtensions ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Type\TypeInterface
 __toString ()
 

Detailed Description

A SPL FileInfo class providing general information related to a file.

Definition at line 23 of file FileInfo.php.

Member Function Documentation

◆ getMimeExtensions()

TYPO3\CMS\Core\Type\File\FileInfo::getMimeExtensions ( )

Returns the file extensions appropiate for a the MIME type detected in the file. For types that commonly have multiple file extensions, such as JPEG images, then the return value is multiple extensions, for instance that could be ['jpeg', 'jpg', 'jpe', 'jfif']. For unknown types not available in the magic.mime database (/etc/magic.mime, /etc/mime.types, ...), then return value is an empty array.

TYPO3 specific settings in $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType'] take precedence over native resolving.

Returns
string[]

Definition at line 81 of file FileInfo.php.

References $GLOBALS, TYPO3\CMS\Core\Type\File\FileInfo\getMimeType(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ getMimeType()

TYPO3\CMS\Core\Type\File\FileInfo::getMimeType ( )

Return the mime type of a file.

TYPO3 specific settings in $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType'] take precedence over native resolving.

Returns
string|bool Returns the mime type or FALSE if the mime type could not be discovered

Definition at line 33 of file FileInfo.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction().

Referenced by TYPO3\CMS\Core\Type\File\ImageInfo\getImageSizes(), and TYPO3\CMS\Core\Type\File\FileInfo\getMimeExtensions().