usagizmo
12/20/2017 - 10:19 AM

Download sample

<?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";
}