code: static public function getMimeType($filePath, $default = 'application/octet-stream')
      {
          $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $filePath);
          if ($mimeType === false) {
              $mimeType = $default;
          }
          
          return $mimeType;
      }
docs: Return mimetype for file
  
  @param string $filePath
  @param string $default
  @return string