OK, the file name must be a created file, it can't be a variable.
This is not correct, and will NOT work:
PHP Code:
<?php
$bytes = $row['event_picture'];
header("Content-type: application/pdf");
header("Content-disposition: attachment; filename=$bytes");
?>
You will have to create a file, have it downloaded, and then optionally delete it when the download completes.
PHP Code:
<?php
$file = "create.pdf";
$fh = fopen($file, 'w') or die("Cannot create file");
$bytes = $row['event_picture'];
fwrite($fh, $bytes);
fclose($fh);
header("Content-type: application/pdf");
header("Content-disposition: attachment; filename=$file");
?>
Bookmarks