in reply to Re^4: printing file downloads
in thread printing file downloads

I see that you understand that there is a -e "exists" file test operator, also there is:
-T is a text file
-B is a binary file (opposite of -T)

If you are going to continue writing Perl, I strongly recommend that that you buy a copy of the language reference manual, Programming Perl by Larry Wall, et. al. In my 3rd edition, page 98 lists a whole slew of these file test operators so many that I can't count at a glance.

if(-B "$filepath$filename"){...file is Binary...}
However, as has been pointed out... ALL files can be sent as faithful copies of the binary bits.