UserFrosting API

MimeType

Maps file extensions to MIME types. Adapted from thephpleague/flysystem.

Tags
author

The PHP League (http://thephpleague.com/)

author

Alex Weissman (https://alexanderweissman.com)

see
https://github.com/thephpleague/flysystem

Table of Contents

detectByFileExtension() Detects MIME Type based on file extension. string|null
detectByFilename() string
getExtensionToMimeTypeMap() array

Methods

detectByFileExtension()

Detects MIME Type based on file extension.

public static detectByFileExtension( $extension : string ) : string|null
Parameters
$extension : string
Return values
string|null

MIME Type or NULL if no extension detected

detectByFilename()

public static detectByFilename( $filename : string ) : string
Parameters
$filename : string
Return values
string

getExtensionToMimeTypeMap()

public static getExtensionToMimeTypeMap( ) : array
Return values
array

Map of file extension to MIME Type

Search results