Description

This function lists all of Apache's MIME types.


cPanel & WHM versions 60 and later do not list PHP versions with MIME types when the user or domain enables PHP-FPM. The system displays  only custom MIME types.

Examples




https://hostname.example.com:2083/cpsess##########/execute/Mime/list_mime?type=user



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List MIME types in Apache
$mime_list_mime = $cpanel->uapi(
    'Mime', 'list_mime',
    array(
        'type'    => 'user',
    )
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List MIME types in Apache
my $mime_list_mime = $cpliveapi->uapi(
    'Mime', 'list_mime',
    {
        'type'    => 'user',
    }
);

 



<!--   List MIME types in Apache -->
[% data = execute( 'Mime', 'list_mime', { type => 'user'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]



uapi --user=username Mime list_mime type=user



{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "extension": ".foo",
      "origin": "user",
      "type": "application/foo"
    }
  ],
  "metadata": {
    "transformed": 1
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
typestring

Required

The MIME types to list.

  • system
  • user
user

Returns

ReturnTypeDescriptionPossible valuesExample
extensionstringThe file extension.A valid file extension..foo
typestringThe MIME type.A valid string.
application/foo
originstringThe handler's owner.
  • system
  • user
user