title: Display images stored outside the public folder in zend framework
body: <p>I have my photo folder stored in the data folder in a Zend Framework application. when i try to read the image files from the data folder to display as a user profile photo in my view i cant get it display and it only show up when i disable my view and layout.</p>
  
  <p>This is my sample code:</p>
  
  <pre><code>$appShortPath = $photPlugin-&gt;getPathToFileFolders();
  
  $databaseFile = '2011/08/18/17c7025cd9f3436e4ad1c02635cc6754.jpg';           
  
  $appPath = $appShortPath . '/data/UploadPhotos/';
  
  if(!isset($databaseFile))
  {
    return false;
  }
  
  $fullPath = $appPath . $databaseFile;
  
  if(!file_exists($fullPath))
  {
    return false;
  }
  
  $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender(true);
  $this-&gt;view-&gt;layout()-&gt;disableLayout();
  
  $image = readfile($fullPath);
  
  header('Content-Type: image/jpeg');
  
  $this-&gt;getResponse()
    -&gt;setHeader('Content-Type', 'image/jpeg');   
  
  $this-&gt;view-&gt;logo = $image;
  </code></pre>
  
  <p>I want to get the profile photos and display it in the user profile page</p>
  
  <p>hope someone can help - thanks </p>