IMimeTypeDetector
in
Interface IMimeTypeDetector
Tags
Table of Contents
Methods
- detect() : string
- detect mimetype based on both filename and content
- detectContent() : string
- detect mimetype only based on the content of file
- detectPath() : string
- detect mimetype only based on filename, content of file is not used
- detectString() : string
- detect mimetype based on the content of a string
- getAllAliases() : array<string, string>
- getSecureMimeType() : string
- Get a secure mimetype that won't expose potential XSS.
- mimeTypeIcon() : string
- Get path to the icon of a file type
Methods
detect()
detect mimetype based on both filename and content
public
detect(string $path) : string
Parameters
- $path : string
Tags
Return values
stringdetectContent()
detect mimetype only based on the content of file
public
detectContent(string $path) : string
Parameters
- $path : string
Tags
Return values
stringdetectPath()
detect mimetype only based on filename, content of file is not used
public
detectPath(string $path) : string
Parameters
- $path : string
Tags
Return values
stringdetectString()
detect mimetype based on the content of a string
public
detectString(string $data) : string
Parameters
- $data : string
Tags
Return values
stringgetAllAliases()
public
getAllAliases() : array<string, string>
Tags
Return values
array<string, string>getSecureMimeType()
Get a secure mimetype that won't expose potential XSS.
public
getSecureMimeType(string $mimeType) : string
Parameters
- $mimeType : string
Tags
Return values
stringmimeTypeIcon()
Get path to the icon of a file type
public
mimeTypeIcon(string $mimeType) : string
Parameters
- $mimeType : string
-
the MIME type
Tags
Return values
string —the url