FileInfo extends SplFileInfo implements TypeInterface

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

Table of Contents

Interfaces

TypeInterface
This is an interface that has to be used by all Core Types.

Methods

getMimeExtensions()  : array<string|int, string>
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.
getMimeType()  : string|false
Return the mime type of a file.

Methods

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.

public getMimeExtensions() : array<string|int, string>

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

Return values
array<string|int, string>

getMimeType()

Return the mime type of a file.

public getMimeType() : string|false

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

Return values
string|false

Returns the mime type or FALSE if the mime type could not be discovered


        
On this page

Search results