display blob Content-Type always text/html no matter what header
('Content-Type: image/jpeg') I've set.
in controller:
function download($id = null) {
$id = 1;
Configure::write('debug', 0);
$this->layout=false;
$this->autoRender = false;
$this->autoLayout= false;
$file = $this->MyFile->findById($id);
header('Content-Type: ' . $file['MyFile']['type']);
echo (base64_encode($file['MyFile']['data']));
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---