I have web application in PHP using apache server, linux. For some security reason i am keeping the documents and images outside web root. How can i show these images, when
As simple as that, this will output the image with correct headers,
remember that you have to set the header() before flushing anything out of the output buffer
=> no echo or print before
$file = '../../somedirectory/image.jpg‘; header('Content-Type:image/jpeg‘); header('Content-Length: '.filesize($file)); echo file_get_contents($file);