here is an error.
you browser knows nothing about the '/tmp' directory on your server.
echo ('<a href="'.$tmp_dir.$file.'">'.$file."</a><br>");
u've to let some other script to serve file download.
so u need to do something like this
and the output.php will have to do the following actions [check for errors plz]:
echo ('<a href=output.php?file="'.$tmp_dir.$file.'">'.$file."</a><br>");
this has to work with all textual files..
$file = $_GET['file'];
$ar = array();
$ar = file($file);
$content = join("\n",$ar);