Page 1 of 1
@file
Posted: Wed Mar 12, 2003 3:06 pm
by nmotion
I use @file to check if an image excist.
Like this:
Code: Select all
if (@file("http://www.somesite.com/image.jpg"))
This works perfectly on one hosting partner and for some reason not on another. Anybody know what could be wrong?
Posted: Wed Mar 12, 2003 3:51 pm
by daven
I would suggest using file_exists() rather than @file.
ex: if(file_exists('your_file_here.ext'))
Useful function, and more efficient.
and in reponse to your original question, without some details as to the hosting partners, what version of php, what OS, etc., we cannot really figure things out.
Posted: Wed Mar 12, 2003 4:11 pm
by nmotion
This only seem to work on local files. Is there a way to check if a file on another web server exists.
Posted: Wed Mar 12, 2003 5:01 pm
by pootergeist
@getimagesize should work on remote files
also, it only reads the header information so would be a lot faster than @file
Posted: Thu Mar 13, 2003 2:06 am
by nmotion
This also works on one server and not the other. The one it does NOT work on is a :
Operating System Linux
Kernel Version 2.4.20-grsec
Last Reboot 12days, 5:44min
Apache Version 1.3.27 (Unix)
Perl Version 5.006001
PHP Version 4.3.1
MySQL Version 3.23.54
cPanel Version 6.0.0-STABLE
cPanel Build 109