Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/05/2010, 03:50
Vallu
 
Fecha de Ingreso: marzo-2010
Ubicación: Barcelona
Mensajes: 657
Antigüedad: 14 años, 1 mes
Puntos: 26
Respuesta: ayuda con la funcion unlink()

Si vas a la funcion unlink del manual php hay un post que dice lo siguiente:

I have founda that trying to delete a file using relative path like the example below does not work.

Código PHP:
<?php 
    $do 
unlink("../pics/$fileToDel"); 
    if(
$do=="1"){ 
        echo 
"The file was deleted successfully."
    } else { echo 
"There was an error trying to delete the file."; } 
?>

I did not work at all, instead what I had to do was:

Código PHP:
<?php 
    chdir
('../pics/'); 
    
$do unlink($fileToDel); 
    if(
$do=="1"){ 
        echo 
"The file was deleted successfully."
    } else { echo 
"There was an error trying to delete the file."; } 
?>

Then it worked !


No se si sera lo mismo para una ruta absoluta, pero por lo menos vale la pena intentarlo