Re: fopen to check if file exists
| From: | Valentin V. Petruchek | Date: | Sat, 08 Dec 2001 11:55:08 +0000 |
| Subject: | Re: fopen to check if file exists | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77112@lists.php.net to get a copy of this message | ||
I've tested given url..
If there is no image php script return file = '139'.
Check if file content is different from 139.
or try to get image size of file:
$size = GetImageSize
("http://waptopic.supereva.it/loghiesuonerie.it/LogoGen.php?id=1100");
and check what happens if there is no image....
Zliy PEs, http://www.zliypes.com.ua
----- Original Message -----
From: "moe" <maurizio@mp3italia.com>
To: <php-general@lists.php.net>
Sent: Saturday, December 08, 2001 1:48 PM
Subject: [PHP] fopen to check if file exists
> I am using this function:
>
> function isAfile($url){
> $fp = @fopen("$url","r");
> if ($fp)
> { //print "The file exists!";
> return 1; }
> else
> { //print "The file does not exist";
> return 0; }
> }
>
> to check if a remote file exists... now the problem is that the URL's i am
> trying to check are in this way:
>
> http://waptopic.supereva.it/loghiesuonerie.it/LogoGen.php?id=1100
> The problem is that LogoGen.php exists but depending on the ID the image
may
> exists or not.
> How can i actually check if the image exists?
> Thanks anyone!
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>