‪TYPO3CMS  ‪main
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

string false getMimeType ()
string[] getMimeExtensions ()
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Type\TypeInterface
string __toString ()

Detailed Description

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

Definition at line 24 of file FileInfo.php.

Member Function Documentation

◆ getMimeExtensions()

string [] TYPO3\CMS\Core\Type\File\FileInfo::getMimeExtensions ( )

Returns the file extensions appropriate 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', 'jiff']. 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.


Definition at line 78 of file FileInfo.php.

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

◆ getMimeType()

string false 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.

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

Definition at line 34 of file FileInfo.php.

References $GLOBALS.

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