getDatabasePath(); if (!file_exists($dbPath)) { http_response_code(500); exit('Base de données introuvable.'); } $filename = 'posterg-db-' . date('Y-m-d') . '.sqlite'; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Content-Length: ' . filesize($dbPath)); header('Cache-Control: no-cache, must-revalidate'); readfile($dbPath); exit;