Description

This function adds a MIME type to Apache.

Examples 




https://hostname.example.com:2083/cpsess##########/execute/Mime/add_mime?type=text%2Ffoo&extension=.foo



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Add MIME type of text/foo to .foo
$mime_add_mime = $cpanel->uapi(
    'Mime', 'add_mime',
    array(
        'type'       => 'text/foo',
        'extension'  => '.foo',
 )
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Add MIME type of text/foo to .foo
my $mime_add_mime = $cpliveapi->uapi(
    'Mime', 'add_mime',
    {
        'type'       => 'text/foo',
        'extension'  => '.foo',
    }
);



<!--  Add MIME type of text/foo to .foo -->
[% data = execute( 'Mime', 'add_mime', {'type' => 'text/foo','extension' => '.foo'} ); %]



uapi --user=username Mime add_mime type=text%2Ffoo extension=.foo



{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null
}



Parameters

ParameterTypeDescriptionPossible valuesExample
typestring

Required

The MIME type.

A valid MIME type.

text/foo
extensionstring

Required

The file extension.

A valid file extension.
.foo

Returns

This function only returns metadata.