Well actually to check .com, just make sure it contains a / then the .com, that will filter yahoo.com, but keep yahoo.com/downloadme.com
On Mon, 2004-02-23 at 14:19, Axel IS Main wrote: > Yes, and in fact that is what I am doing now. This is a spider bot > though, so I'm having to think of every single type of binary file that > could be linked to on the web. So far I'm up to 28 with no end in sight. > What about a .com file? I can't omit links that end in .com can I? That > would be counterproductive to say the least. Also, the function that > does the checking just keep getting longer and longer, which makes the > spider go slower and slower. Granted, the thing is pretty fast if it has > enough BW to work with, but still. This could eventually turn into a > script killer. Detecting whether the stream from file_get_contents(), or > fopen() for that matter, is binary or not and going with that result is > the elegant solution to this problem. There has to be a way to do it. > > Nick > > Adam Voigt wrote: > > >Couldn't you just check the extension on the file? > > > > > >On Mon, 2004-02-23 at 14:03, Axel IS Main wrote: > > > > > >>Guys, this isn't THAT stupid of a question is it? From my perspective, > >>the way PHP seems to see it is that I should already know what kind of > >>file I'm looking at. In most cases that's not an unreasonable > >>assumption. Unfortunately, that's only good for most cases. PHP is rich > >>in ways to work with the HTTP protocol, but has no way of detecting > >>whether it's opening a text file or a binary file. To me this is a > >>glaring omission. There has to be a way to do it, even if it's a > >>round-a-bout or backdoor kind of way. Nothing is impossible. > >> > >>Nick > >> > >>Axel IS Main wrote: > >> > >> > >> > >>>I'm using file_get_contents() to open URLs. Does anyone know if there > >>>is a way to look at the result and determine if the file is binary? > >>>I'd like to be able to block binaries from being processed without > >>>having to try to think of all the possible binary extensions and omit > >>>them with a function that looks for these extensions. > >>> > >>>Nick > >>> > >>> > >>> -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php