Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/07/2004, 18:53
Avatar de pereztroff
pereztroff
 
Fecha de Ingreso: junio-2002
Ubicación: En la Internet.
Mensajes: 4.068
Antigüedad: 21 años, 10 meses
Puntos: 5
no me sube archivos ¿porque?

tengo 3 archivos de prueba para ver el manejo del upload de archivos, en este caso imagenes.

index.html:
--------------
Código PHP:
<form action="../upload/files.php" METHOD="post" enctype="multipart/form-data"
files.php
------------------
Código PHP:
<?php
require '../upload/upload.php';
$upload = new HTTP_Upload('es');       // Language for error messages
$file $upload->getFiles('userfile'); // return a file object or error
if (PEAR::isError($file)) {
    die (
$file->getMessage());
}
// Check if the file is a valid upload
if ($file->isValid()) {
    
// this method will return the name of the file you moved,
    // useful for example to save the name in a database
    
$file_name $file->moveTo('../upload/fotos/');
    if (
PEAR::isError($file_name)) {
        die (
$file_name->getMessage());
    }
}
?>
***********despues pongo la segunda parte*********