How to detect if a file to upload is

a binary file or a text(ascii) file?
I dont want to upload binary files but I dont know how to determine if the candidate file is binary or ascii.
Does anyone know a way to do this using javascript?
[216 byte] By [trinitron] at [2007-11-18 18:24:35]