$dir = __DIR__ . "/files";if (!is_dir($dir)) { mkdir($dir, 0775, true);}// Descargar archivoif (isset($_GET['file'])) { $file = basename($_GET['file']); $path = $dir . "/" . $file; if (file_exists($path)) { header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$file\""); header("Content-Length: " . filesize($path)); readfile($path); exit; } else { echo "Archivo no encontrado."; exit; }}<!DOCTYPE html>
<meta charset="UTF-8">