'text/html',
'css' => 'text/css',
'js' => 'application/javascript',
'png' => 'image/png',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'gif' => 'image/gif'
];
$contentType = $contentTypes[$extension] ?? 'text/plain';
header("Content-Type: $contentType");
readfile($path);
exit;
}
if ($shouldOutputHTML) {
echo "";
echo "";
echo "
";
echo '';
echo '';
echo "";
echo "Blyat Cyka Files";
echo "";
echo "";
echo " Blyat Cyka Files Here: " . htmlspecialchars($currentDir) . "
";
if ($currentDir != '.') {
echo "../
";
}
$items = scandir($currentDir);
echo "";
foreach ($items as $item) {
if ($item == '.' || ($item == '..' && $currentDir == '.')) {
continue;
}
if (is_dir($currentDir . '/' . $item)) {
echo "- $item/
";
} else {
echo "- $item
";
}
}
echo "
";
echo "------------Cyka------------
";
echo "";
echo "";
}