Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/02/2006, 05:59
molina669
 
Fecha de Ingreso: julio-2005
Mensajes: 110
Antigüedad: 18 años, 9 meses
Puntos: 1
Error al subir foto al servidor

Mi problema está en que no se sube la foto correctamente, si se sube el fichero, pero al intentar abrirlo no sale la foto.
El formulario html está bien creado:
Código:
FORM ACTION="foto.php" METHOD=POST NAME=foto ENCTYPE="multipart/form-data">
                    <INPUT NAME=foto TYPE="file">
Código:
<?
include ("../conex.php");
$usuario=$_POST["idEquipo"];
$image = $HTTP_POST_FILES['foto']['tmp_name'];
$image_name = $HTTP_POST_FILES['foto']['name'];
$extension=explode(".",$image_name);
$image_size = $HTTP_POST_FILES['foto']['size'];
$image_type = $HTTP_POST_FILES['foto']['type'];
$image_error = $HTTP_POST_FILES['foto']['error'];
if ($image_error > 0)
{
echo 'Problem: ';
switch ($image_error)
{
case 1:  echo 'File exceeded upload_max_filesize';  break;
case 2:  echo 'File exceeded max_file_size';  break;
case 3:  echo 'File only partially uploaded';  break;
case 4:  echo 'No file uploaded';  break;
}
exit;
}
//if ($image_type != 'text/plain')
//{
//echo 'Problem: file is not plain text';
//exit;
//}
$upfile = '../subidas/'.$usuario.'/'.$usuario.'.'.$extension[1];
if (is_uploaded_file($image))
  {
     if (!move_uploaded_file($image, $upfile))
     {
        echo 'Problem: Could not move file to destination directory';
        exit;
     }
  }
  else
  {
    echo 'Problem: Possible file upload attack. Filename: '.$image_name;
    exit;
  }
echo 'File uploaded successfully<br /><br />';
La verdad, no se donde puede estar el error.