Hi,

I was trying to get an image to display using the following:

  function display($id) {
    Configure::write('debug', 0);
    $file = $this->Image->findById($id);
    $data = $file['Image']['image'];
    $type = $file['Image']['type']
    header("Content-type: ".$type);
    echo $data;
  }

obviously (but not to me) you cant set the variable off the array
value or something?  - i r noob

This fixed it:

  function display($id) {
    Configure::write('debug', 0);
    $file = $this->Image->findById($id);
    header("Content-type: ".$file['Image']['type']);
    echo $file['Image']['image'];
  }

Anyway echo out the array value and it worked perfectly. Hope this
helps somebody else.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to