Deberias de hacerlo asi:
Código PHP:
<?php
$f=$_GET["f"];
$carpeta=$_GET["carpeta"];
$enlace=$carpeta."/".$f;
if( !file_exists( $enlace ) ) {
echo '$enlace no es un archivo o no existe: ' . $enlace;
exit();
}
header("Content-Disposition: attachment; filename=".$f);
header("Content-Type: application/octet-stream");
$fp=fopen($enlace,"r");
fpassthru($fp);
?>