alert('✅ Saved!'); window.location='?path=" . urlencode($current) . "';"; } else { echo ""; } exit; } if (!file_exists($itemPath)) { echo "

Error: File not found!

"; echo "← Back"; exit; } $content = htmlspecialchars(file_get_contents($itemPath)); echo " Edit File ← Back to Directory
Editing: " . htmlspecialchars($item) . "
Path: " . htmlspecialchars($itemPath) . "
Writable: " . (is_writable($itemPath) ? 'Yes ✅' : 'No ❌') . "

"; exit; } // Delete işlemi if (isset($_GET['action']) && $_GET['action'] === 'delete' && !empty($item)) { debug_log("Delete action - Path: $itemPath"); if (file_exists($itemPath)) { if (is_dir($itemPath)) { if (rmdir($itemPath)) { debug_log("Folder deleted: $itemPath"); } else { debug_log("Failed to delete folder: $itemPath"); } } else { if (unlink($itemPath)) { debug_log("File deleted: $itemPath"); } else { debug_log("Failed to delete file: $itemPath"); } } } header("Location: ?path=" . urlencode($current)); exit; } // Rename işlemi if (isset($_GET['action']) && $_GET['action'] === 'rename' && !empty($item)) { if ($_SERVER['REQUEST_METHOD'] === 'POST') { $newName = basename($_POST['new_name']); $newPath = $current . "/" . $newName; debug_log("Rename: $itemPath -> $newPath"); if (!file_exists($newPath)) { if (rename($itemPath, $newPath)) { debug_log("Rename SUCCESS"); } else { debug_log("Rename FAILED"); } } header("Location: ?path=" . urlencode($current)); exit; } echo " Rename ← Back

Rename: " . htmlspecialchars($item) . "

"; exit; } // Upload işlemi sayfası if (isset($_GET['upload'])) { echo " Upload File ← Back to Directory

📤 Upload File

Upload to: " . htmlspecialchars($current) . "
Directory writable: " . (is_writable($current) ? '✅ Yes' : '❌ No') . "

"; exit; } // Upload handler if (isset($_GET['upload_handler'])) { $targetDir = $_GET['path'] ?? getcwd(); $targetDir = realpath($targetDir); debug_log("Upload handler - Target dir: $targetDir"); debug_log("POST data: " . print_r($_POST, true)); debug_log("FILES data: " . print_r($_FILES, true)); if (!empty($_FILES['file']['name'])) { $fileName = basename($_FILES['file']['name']); $targetFile = $targetDir . "/" . $fileName; debug_log("Uploading: $fileName to $targetFile"); debug_log("Temp file: " . $_FILES['file']['tmp_name']); debug_log("Upload error code: " . $_FILES['file']['error']); if (move_uploaded_file($_FILES['file']['tmp_name'], $targetFile)) { chmod($targetFile, 0644); debug_log("Upload SUCCESS: $targetFile"); echo ""; } else { $errorMsg = "Upload FAILED. Error: " . $_FILES['file']['error']; debug_log($errorMsg); echo ""; } } else { debug_log("No file uploaded"); header("Location: ?path=" . urlencode($targetDir)); } exit; } // Create folder if (isset($_POST['create_folder'])) { $folderName = basename($_POST['folder_name']); if (!empty($folderName)) { $folderPath = $current . "/" . $folderName; debug_log("Create folder: $folderPath"); if (!file_exists($folderPath)) { if (mkdir($folderPath, 0755)) { debug_log("Folder created"); } else { debug_log("Folder creation FAILED"); } } } header("Location: ?path=" . urlencode($current)); exit; } // Create file if (isset($_POST['create_file'])) { $fileName = basename($_POST['file_name']); if (!empty($fileName)) { $filePath = $current . "/" . $fileName; debug_log("Create file: $filePath"); if (!file_exists($filePath)) { $result = file_put_contents($filePath, $_POST['file_content'] ?? ''); if ($result !== false) { chmod($filePath, 0644); debug_log("File created, bytes: $result"); } else { debug_log("File creation FAILED"); } } } header("Location: ?path=" . urlencode($current)); exit; } ?> File Manager

📁 File Manager

Directory is empty

"; return; } echo ""; } ?>
📍 Current Path:
⬆ Up 🏠 Root

📤 Upload File

Upload File →

📁 Create Folder


📄 Create File