I am developing a security for my downloadable contents simply securing my download content like this.
<?php
$file = 'monkey.gif';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
Now I simply want to add 100 extra bytes (my custom details about that download file as per each download)
I want some way to add these 100 bytes after readfile($file); so downloaded file will have this extra information in it.
something like
readfile($file) + myBytes()
I am new to PHP so please help me