You are here

private static function FMDiskFileSystem::getMimeType in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

3 calls to FMDiskFileSystem::getMimeType()
FMDiskFileSystem::getImageOriginal in vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php
FMDiskFileSystem::getImagePreview in vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php
FMDiskFileSystem::resizeFile in vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php

File

vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php, line 492

Class

FMDiskFileSystem

Namespace

EdSDK\FlmngrServer\fs

Code

private static function getMimeType($filePath) {
  $mimeType = NULL;
  $filePath = strtolower($filePath);
  if (FMDiskFileSystem::endsWith($filePath, '.png')) {
    $mimeType = "image/png";
  }
  if (FMDiskFileSystem::endsWith($filePath, '.gif')) {
    $mimeType = "image/gif";
  }
  if (FMDiskFileSystem::endsWith($filePath, '.bmp')) {
    $mimeType = "image/bmp";
  }
  if (FMDiskFileSystem::endsWith($filePath, '.jpg') || FMDiskFileSystem::endsWith($filePath, '.jpeg')) {
    $mimeType = "image/jpeg";
  }
  if (FMDiskFileSystem::endsWith($filePath, '.webp')) {
    $mimeType = "image/webp";
  }
  if (FMDiskFileSystem::endsWith($filePath, '.svg')) {
    $mimeType = "image/svg+xml";
  }
  return $mimeType;
}