How to check if a file exist on an External Server? I have a url “http://logs.com/logs/log.csv” and I have an script on another server to check if this file exists. I tried
$handle = fopen("http://logs.com/logs/log.csv","r");
if($handle === true){
return true;
}else{
return false;
}
and
if(file_exists("http://logs.com/logs/log.csv")){
return true;
}else{
return false;
}
These methos just do not work
Make sure error reporting is on.
Use
if($handle)Check allow_url_fopen is true.
If none of this works, use this method on the file_exists page.