Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/04/2011, 13:16
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: Comprobar fichero

Podrías hacer algo así
Código PHP:
Ver original
  1. <?php
  2. if(array_key_exists('file', $_FILES)){
  3.     if($_FILES["file"]["error"] == UPLOAD_ERR_OK){
  4.         $name = strtolower($_FILES["file"]["name"]);
  5.         $url = substr($name, 0, 1) . '/' . $name;
  6.         if(file_exists($url)){
  7.             echo 'Archivo <b>' . $url . '</b> existe';
  8.         }
  9.     }
  10. }
  11. ?>
  12. <html>
  13. <body>
  14.  
  15. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
  16. <label for="file">Filename:</label>
  17. <input type="file" name="file" id="file" />
  18. <br />
  19. <input type="submit" name="submit" value="Submit" />
  20. </form>
  21.  
  22. </body>
  23. </html>
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos