Have you checked to make sure the header is being set correctly? Or that you're getting a good record from the DB (you should have a test in there beore echoing anything out).
Try: $this->log($file['MyFile']['type']); You also might want to set a Content-length header. On Sun, May 24, 2009 at 12:59 AM, Kev <[email protected]> wrote: > > 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 -~----------~----~----~----~------~----~------~--~---
