The select command will try to display every field separated by spaces, tabs, and newline characters. So I don't think your sample will do what you want. You must not use "ls -l" for long listing or the permissions and ownerships and file sizes will all be fields displayed in the select statement results.
Not sure if this is exactly what you were looking for, but it finds all files (no directories or symbolic links) and decides whether to process it as a PostgreSQL backup or just a regular file. You could always adapt it to look for whatever it is you hope to find in the downloads directory.
You could look at changing the if statement to a case and try to find specific extensions. So you find the .tar or .gz or .cpio, and so on. Just figure out how to strip off the extension.
#!/bin/bash
download="/tempfs"
cd $download
options=$(ls -l |grep -v "^d" |awk '{print $9}')
select option in $options
do
if test "$(echo $option|grep ".dmp$")" = ""
then
echo "Process as normal file: ${option}"
exit 0
else
echo "Process as pg_dump file: ${option}"
exit 0
fi
done
ls -1 $download