Hello Axel, Monday, February 23, 2004, 7:03:38 PM, you wrote:
AIM> Guys, this isn't THAT stupid of a question is it? From my perspective, AIM> the way PHP seems to see it is that I should already know what kind of AIM> file I'm looking at. In most cases that's not an unreasonable AIM> assumption. Unfortunately, that's only good for most cases. PHP is rich Even Windows doesn't *know* what type of file you've got until you actually try and open it. You could rename a jpg to mp3 and you won't know about it until Winamp moans at you as you open it. AIM> in ways to work with the HTTP protocol, but has no way of detecting AIM> whether it's opening a text file or a binary file. To me this is a AIM> glaring omission. There has to be a way to do it, even if it's a AIM> round-a-bout or backdoor kind of way. Nothing is impossible. You could say it's a glaring omission from operating systems too, because most succumb to this. The only way to tell for sure is to read in the header of the file and parse it. If you are blanket rejecting all binaries - good luck, it'll take ages. Another solution might be to just treat the file as text regardless and strip out every byte that is above the standard ASCII value. Hello CPU upgrade requirement. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

