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:
La verdad, no se donde puede estar el error. <? 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 />';