<?php $path=TGET('path'); $fullpath=$Config->Paths['upload'].'/'.$path; if (file_exists($fullpath)) { header("Expires: Tue, 19 Jan 2038 03:14:07 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s",filemtime($fullpath)) . " GMT"); $Config->DisplayExecutionTime=false; $mime_type=false; switch (pathinfo($path,PATHINFO_EXTENSION)) { case 'gif': $mime_type='image/gif'; break; case 'jpg': case 'jpeg': $mime_type='image/jpeg'; break; case 'png': $mime_type='image/png'; break; } send_file($fullpath,$mime_type,!$mime_type,$Config->Limits['download_peakrate']); $CMD_TMPL_NAME=null; } else { header("HTTP/1.0 404 Not Found"); echo "Failed to retrieve file."; } ?>