RE: [PHP-ES] file_exists
| From: | Roberto Celestino | Date: | Thu, 18 Jul 2002 16:45:41 +0000 |
| Subject: | RE: [PHP-ES] file_exists | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-25043@lists.php.net to get a copy of this message | ||
Si te fijas, te falta un )
if (file_exists($path){
debe ser
if (file_exists($path)){
ademas,podes usar en vez de \\ para separar el path, la / y funciona igual.
Sino fijate en el manual algo de sintaxis, o de file functions.
Suerte!
-----Mensaje original-----
De: Aldo Quezada V. [mailto:aquezada@bsp-inspector.cl]
Enviado el: jueves, 18 de julio de 2002 12:56
Para: lista@phpes.com
Asunto: [PHP-ES] file_exists
Amigos:
tengo un pequeño problema, necesito saber si un archivo existe en un
directorio he hecho las pruebas de este modo
if (file_exists('prueba.jpg'){
echo "<LI><FONT SIZE='3' COLOR='red'><b>IMAGEN YA
EXISTE</b></FONT><br>";
}
dandole un archivo existente en el mismo directorio
y dandole una ruta
$path =
"z:\\test\\archivos\\u".$ubic."\\".$HTTP_POST_FILES['foto'.$i]['name']."";
echo $path;
// aqui me imprime esto
z:\test\archivos\u24955\Muestra.jpg
// fin comentario
if (file_exists($path){
echo "<LI><FONT SIZE='3' COLOR='red'><b>IMAGEN YA
EXISTE</b></FONT><br>";
}
esto esta en window NT y php version 4.1.2
y me envia parse error en la linea de file_exists
---------------------------------------------------------------------
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