2013-03-28 18:38:50 -07:00
|
|
|
<?php if (file_exists($attachment['Attachment']['file'])) {
|
2012-11-18 12:19:55 -08:00
|
|
|
header('Content-Description: File Transfer');
|
|
|
|
|
header('Content-Type: application/octet-stream');
|
2013-04-09 02:37:04 -07:00
|
|
|
header('Content-Disposition: attachment; filename="'.basename($attachment['Attachment']['filename']).'"');
|
2012-11-18 12:19:55 -08:00
|
|
|
header('Content-Transfer-Encoding: binary');
|
|
|
|
|
header('Expires: 0');
|
|
|
|
|
header('Cache-Control: must-revalidate');
|
|
|
|
|
header('Pragma: public');
|
2013-03-28 18:38:50 -07:00
|
|
|
header('Content-Length: ' . filesize($attachment['Attachment']['file']));
|
2012-11-18 12:19:55 -08:00
|
|
|
ob_clean();
|
|
|
|
|
flush();
|
2013-03-28 18:38:50 -07:00
|
|
|
readfile($attachment['Attachment']['file']);
|
2012-11-18 12:19:55 -08:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|