Fixed downloader maybe?
This commit is contained in:
parent
647c54e8d7
commit
57cf88deb9
|
|
@ -10,10 +10,11 @@ function download($id) {
|
||||||
$file = $this->EmailAttachment->findById($id);
|
$file = $this->EmailAttachment->findById($id);
|
||||||
header('Content-type: ' . $file['EmailAttachment']['type']);
|
header('Content-type: ' . $file['EmailAttachment']['type']);
|
||||||
header('Content-length: ' . $file['EmailAttachment']['size']);
|
header('Content-length: ' . $file['EmailAttachment']['size']);
|
||||||
header('Content-Disposition: attachment; filename="'.$file['EmailAttachment']['name'].'"');
|
header('Content-Disposition: attachment; filename='.basename($file['EmailAttachment']['name']));
|
||||||
ob_clean();
|
ob_clean();
|
||||||
flush();
|
flush();
|
||||||
readfile($file['EmailAttachment']['filename']);
|
readfile($file['EmailAttachment']['filename']);
|
||||||
|
// echo $file['EmailAttachment']['filename']
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue