Re: Re: file_exists($file)
| From: | Gabriel Snyrynskyj | Date: | Thu, 31 Oct 2002 22:47:56 +0000 |
| Subject: | Re: Re: file_exists($file) | ||
| References: | 1 2 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-28737@lists.php.net to get a copy of this message | ||
Ahhhhh. Ahora sí. Mucísimas gracias.
Gabriel
----- Original Message -----
From: "Fernando Herrero Peletero" <fherrero@noticiasdenavarra.com>
To: <lista@phpes.com>
Sent: Thursday, October 31, 2002 5:38 PM
Subject: [PHP-ES] Re: file_exists($file)
> > $file=http://www.php.net/gifs/php_logo.gif;
> > y quiero saber si realmente existe ese fichero. Entonces
> >
> > if (file_exists($file)){
> > echo "El fichero existe";
> > }else{
> > echo "El fichero no existe";
> > }
> >
> > El problema surge que el fichero si existe pero siempre me dice que no
es
> > así. Estamos todos locos?
>
> No, simplemente file_exists() como filesize() y otras funciones (supongo)
no
> funcionan con ficheros remotos... yo lo que hago es intentar abrir el
> fichero:
>
> if (!@$handle = fopen($file, 'rb')) {
> echo "El fichero no existe";
> } else {
> fclose($handle);
> echo "El fichero existe";
> }
>
> Tan simple como eso.
>
>
>
> ---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> via news: news://news.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com
>
>
>
>