Файл: _rootadmin/_showimage.inc.php
Строк: 43
<?
if ($file) {
if (checkAdminAccess('showPassportAllow')) {
$filefull=$full_home_path."/_rootfiles/".$file;
if (@file_exists($filefull)) {
if (preg_match("/.jpg$/",$filefull)) { $contentType = "image/jpeg"; }
else if (preg_match("/.gif$/",$filefull)) { $contentType = "image/gif"; }
else if (preg_match("/.png$/",$filefull)) { $contentType = "image/png"; }
else if (preg_match("/.pdf$/",$filefull)) { $contentType = "application/pdf"; }
header ("Content-Type: $contentType");
header ("Accept-Ranges: bytes");
header ("Content-Length: ".filesize($filefull));
header ("Content-Disposition: filename=".$file);
$handle=fopen($filefull,r);
$contents = fread($handle, filesize($filefull));
fclose($handle);
print $contents;
} else {
print "File $filefull not found.";
}
} else {
print "<center><font color=red>Access denied!</font></center>";
}
}
?>