Menu

Reference / Http

mimeFor()

function
function mimeFor(string $path): string

The Content-Type for a file name, chosen by its extension (case-insensitive).

Text types carry charset=utf-8. An unknown or missing extension gives application/octet-stream. Response::file() uses this when no type is passed.

Parameters

$path string
File path or name. Only the part after the last . of the last path segment matters.

Returns

string — A media type such as text/html; charset=utf-8 or image/png.

View source