$archivo=$id_usuario.".txt"; $ruta = 'ficheros/'.$archivo; if (is_file($ruta)) { header('Content-Type: application/force-download'); header("Content-type: application/octet-stream"); header('Content-Disposition: attachment; filename='.$archivo); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize($ruta)); ob_end_clean(); readfile($ruta); } else { exit();} ?>