<?php
$file = realpath($_GET["file"]);
$filename = basename($file);
if($file && isset($file) && file_exists($file)) {
header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=$filename");
header('Content-Length: '.filesize($file));
readfile($file);
} else {
echo "No file selected";
}