Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MimeTypeExtensionMap.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  protected $mimeTypeExtensionMap = [
17  'image/jpg' => 'jpg',
18  'image/jpeg' => 'jpg',
19  'image/gif' => 'gif',
20  'image/png' => 'png',
21  ];
22 
27  public function getMimeTypeExtension($mimeType)
28  {
29  if (isset($this->mimeTypeExtensionMap[$mimeType])) {
30  return $this->mimeTypeExtensionMap[$mimeType];
31  } else {
32  return "";
33  }
34  }
35 }