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
|
edit
file path or object Alias: FilePath, source, path, FileObject |
|
|
strict
boolean,
optional
|
edit
if set to true, Lucee checks the header of the file, when set to false, Lucee only checks the extension. Alias: checkHeader, checkNotExtension |
true |
Usage Notes
editSince Lucee 6, this function now throws an exception when an empty or missing file is passed in
Examples
editfile = filegetmimetype(filepath/filename.ext);
writeDump(file);
See also
- File handling
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)