Description

This function adds an Apache MIME type handler for a specific file extension.

Examples 


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_handler = $cpanel->api1('Mime', 'add_handler', array('.txt','text/plain') ); // Call the function.

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $add_handler = $cpliveapi->api1('Mime', 'add_handler', ['.txt','text/plain'] ); # Call the function.

<cpanel Module="Mime::add_handler( $FORM('ext','handler') )">
cpapi1 --user=username Mime add_handler .txt text/plain

This function does not return output.

Parameters

ParameterTypeDescriptionPossible ValuesExample
exts
string

Required

The file extension for which to add a MIME handler.

Any valid file extension.
.txt
handler
string

Required

The handler to add.

A valid MIME handler type.text/plain

Returns

This function does not return output.