18 lines
606 B
PHP
18 lines
606 B
PHP
<?php if (file_exists($attachment['Attachment']['filename'])) {
|
|
header('Content-Description: File Transfer');
|
|
header('Content-Type: application/octet-stream');
|
|
header('Content-Disposition: attachment; filename='.basename($attachment['Attachment']['filename']));
|
|
header('Content-Transfer-Encoding: binary');
|
|
header('Expires: 0');
|
|
header('Cache-Control: must-revalidate');
|
|
header('Pragma: public');
|
|
header('Content-Length: ' . filesize($attachment['Attachment']['filename']));
|
|
ob_clean();
|
|
flush();
|
|
readfile($attachment['Attachment']['filename']);
|
|
exit;
|
|
}
|
|
|
|
?>
|
|
|