I would like to check whether a distant file , eg a ".zip" file, exists or not.
1) When the site on which the file is located has no "own 404 page",
everything is fine : a simple fopen($url,"r") enables me to know whether the
file ($url) exists or not.
2) When the site on which the file is located has an "own 404 page" ( e.g.
members.xoom.com ), it's much less easy. If the file ($url) doesn't exist,
the site host redirects your browser to the own-404-page. Thus the fopen tip
no longer works to check whether a file exists or not.
The following tip has already been tested but with no success :
$fp=fsockopen("www.php.com", 80, $errno, $errstr, 30);
or
$fp=fsockopen(www.notexistingdomain.com, 80, $errno, $errstr, 30);
works great with domains
But doesn't with things like :
$fp=fsockopen("www.adomain.com/asubdomain/adir/afile.zip", 80, $errno,
$errstr, 30);
For example, here's the kind of things I want to check :
http://members.aol.com/knanicat/irish.exe // This file
exists
http://members.aol.com/knanicat/irish2736743746.exe // This file does not
exist but when this URL is written in the URL address bar, AOL redirects
your browser an an "own404page".
Has anybody any idea about a way to solve that ?
Thanks