You are here: Re: How to check if uploaded file is binary or ascii? « PHP Programming Language « IT news, forums, messages
Re: How to check if uploaded file is binary or ascii?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация