FileGetMimeType()

Returns the mimetype of the given file

Using the Apache Tika Library

FileGetMimeType( file=any, strict=boolean );

Returns: String

Argument Description Default
file
any, required

file path or object

Alias: FilePath, source, path, FileObject

strict
boolean, optional

if set to true, Lucee checks the header of the file, when set to false, Lucee only checks the extension.

Alias: checkHeader, checkNotExtension

true

Examples

file = filegetmimetype(filepath/filename.ext);
writeDump(file);

See also