include_once 'dbconnect.php';
$query = "SELECT * " . "FROM download WHERE username = '" . $username . "'";
$stmt = $conn1->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll();
$blob = $result[0]["File"];
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=download.exe");
header("Content-length: " . strlen($blob));
echo $blob;
I have this code, when it downloads the executable is only 1 MB while the file should be 13 MB