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
For my application, none of those answers were working - I simply couldn't get the image to display and it wasn't really feasible for me to add a new php file to call because reasons. What DID work for me is
$filename = read_filename_from_database;
$fileDir = "/path/to/files/";
$file = $fileDir . $filename;
if (file_exists($file))
{
$b64image = base64_encode(file_get_contents($file));
echo "
";
}