This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

You can learn more about working with files here (link to files overview). The File MIME types helper contains useful functions when working specifically with MIME types.

Loading the Helper

$fh = Loader::helper(‘mime’);

Methods

$r = $fh->mimeFromExtension($extension)

Returns a MIME type given an extension

print $fh->mimeFromExtension(‘.jpg’); // outputs ‘image/jpeg’

$extension = $fh->mimeToExtension($mime)

Converts a known mime-type into its common file extension.

Loading Conversation