Posted by Colin McKinnon on 09/01/06 19:22
Marcin Dobrucki wrote:
> veg_all@yahoo.com wrote:
>> Chung Leong wrote:
>>
>>>Just look for \x00. Binary files would inevitable have it.
>>
>> Thanks. Is there a way to do it without reading in the entire file to
>> memory?
>
> On linux/unix you can call "file" on the uploaded file.
'file' is very good at guessing file types - but it's still a guess and
possible to circumvent if you're up to mischief.
A better solution is to 'cat -v' the file. Some versions of tr support
regexes too.
C.
Navigation:
[Reply to this message]
|