<?php
session_name('super_admin_session');
if (!is_dir(dirname(__DIR__) . '/session_data/super')) { mkdir(dirname(__DIR__) . '/session_data/super', 0700, true); } session_save_path(dirname(__DIR__) . '/session_data/super');
session_set_cookie_params(['path' => '/', 'httponly' => true, 'samesite' => 'Strict']);
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['sid']==0)) {
 header('location:logout.php');
} 
$sql = "SELECT file_data, file_name, file_type FROM feedback WHERE file_name = '" . $_GET["file"] . "'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($result);
header("Content-Disposition: attachment; filename=" . $row["file_name"]);
header("Content-Type: " . $row["file_type"]);
header("Content-Length: " . strlen($row["file_data"]));
echo $row["file_data"];
mysqli_close($con);
?>
