How can i make a PHP script that will allow me to download a file from a database in MySQL.
I have the following table named files where the uploaded file is sa
you can use session and post filename and file content to download page
session_start();
$_SESSION['filename'] = $filename
$_SESSION['file'] = $file
echo "Download File"
and in download.php use this code
session_start();
$filename = $_SESSION['filename'];
$file = $_SESSION['file'];
header("Content-Disposition: attachment; filename=$filename");
ob_clean();
flush();
echo $file;