I have also tried using fpassthru, but it will not interpret images at all.
Code: Select all
<?
$dir="/path/on/server/";
$name="filename.ext";
chdir($dir);
header("Content-disposition: inline; filename=$name");
header("Content-type: $mimetype"); # If I comment out this line, text files are interpreted (displayed) correctly, aside from the opening <? line. However, images are not.
$arr=file($name);
$sca=implode("",$arr);
echo nl2br($sca);
?>