Page 1 of 1
Checking if a file exists --> Distant files
Posted: Fri Apr 11, 2003 6:52 pm
by Meriouma
Hi,
Anyone know if there's a way to know if a file exist on a distant server?
thanks
Posted: Fri Apr 11, 2003 8:05 pm
by phice
Code: Select all
<?php
echo readfile($FILE_LOCATION) or die("Unable to find file.");
?>
Posted: Fri Apr 11, 2003 8:16 pm
by volka
readfile() will print the content of the file. Maybe
fopen() is sufficient.
If url_wrappers are disabled you might use
php's ftp-functions or
open a socket (if available) to send a http-request and check the response code.