public static function get_mime_type($filename) {
		if (extension_loaded('fileinfo')) {
			try {
				$finfo = new \finfo(FILEINFO_MIME_TYPE);
				return $finfo->file($filename);
			} catch (\Exception $e) {
				// Try next option...
			}
		}

		if (function_exists('mime_content_type')) {
			try {
				return mime_content_type($filename);
			} catch (\Exception $e) {
				// Try next option...
			}
		}

		$mime = \pdyn\filesystem\Mimetype::ext2mime(static::get_ext($filename));

		// Strip out encoding, if present.
		if (mb_strpos($mime, ';') !== false) {
			$mime = explode(';', $mime);
			$mime = $mime[0];
		}
		return $mime;
	}