$filename=$_GET["file"]; $dir="dir/"; header('Content-type: application/txt'); header('Content-Disposition: attachment; filename=$dir$filename');