IMimeTypeDetector
Interface IMimeTypeDetector
Tags
Table of Contents
- 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
- 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
string —detectContent()
detect mimetype only based on the content of file
public
detectContent(string $path) : string
Parameters
- $path : string
Tags
Return values
string —detectPath()
detect mimetype only based on filename, content of file is not used
public
detectPath(string $path) : string
Parameters
- $path : string
Tags
Return values
string —detectString()
detect mimetype based on the content of a string
public
detectString(string $data) : string
Parameters
- $data : string
Tags
Return values
string —getSecureMimeType()
Get a secure mimetype that won't expose potential XSS.
public
getSecureMimeType(string $mimeType) : string
Parameters
- $mimeType : string
Tags
Return values
string —mimeTypeIcon()
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