Просмотр файла mail/download.php
<?php $fi = htmlspecialchars($_GET['file']); $file = "files/$fi"; if(!is_file($file)){ echo '<h2>File not found on the server</h2>'; } else { header('Content-type: image/*'); header('Content-Disposition: attachment; filename="'.$_SERVER['HTTP_HOST'].'_'.$fi.'"'); readfile($file); }