\OCP\FilesIMimeTypeDetector

Interface IMimeTypeDetector

Summary

Methods
Constants
detectPath()
detect()
getSecureMimeType()
detectString()
mimeTypeIcon()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

detectPath()

detectPath(string  $path) : string

detect mimetype only based on filename, content of file is not used

Parameters

string $path

Returns

string

detect()

detect(string  $path) : string

detect mimetype based on both filename and content

Parameters

string $path

Returns

string

getSecureMimeType()

getSecureMimeType(string  $mimeType) : string

Get a secure mimetype that won't expose potential XSS.

Parameters

string $mimeType

Returns

string

detectString()

detectString(string  $data) : string

detect mimetype based on the content of a string

Parameters

string $data

Returns

string

mimeTypeIcon()

mimeTypeIcon(string  $mimeType) : string

Get path to the icon of a file type

Parameters

string $mimeType

the MIME type

Returns

string —

the url