Back

addFormat()

Adds a new MIME type to your CFWheels application for use with responding to multiple formats.

Name Type Required Default Description
extension string Yes File extension to add.
mimeType string Yes Matching MIME type to associate with the file extension.
// Add the `js` format
addFormat(extension="js", mimeType="text/javascript");

// Add the `ppt` and `pptx` formats
addFormat(extension="ppt", mimeType="application/vnd.ms-powerpoint");
addFormat(extension="pptx", mimeType="application/vnd.ms-powerpoint");
Copied!