Este es el código en el php que utilizo:
Código PHP:
case "alta2_producto":
$registros2=mysql_fetch_array(mysql_query("SELECT * FROM productos ORDER BY id_producto DESC"));
$registros2["id_producto"]+=1;
echo($foto_chica." ".$_FILES['foto_chica']['tmp_name']);
echo(" ".$foto_grande." ".$_FILES['foto_grande']['tmp_name']);
if (($foto_chica=="")||($foto_grande==""))
{
$f_grande="no_foto.jpg";
$f_chica="no_foto_chica.jpg";
}
else
{
$f_grande=$registros2["id_producto"].".jpg";
$f_chica=$registros2["id_producto"]."_chica.jpg";
$uploaddir = '../images/';
$uploadfile = $uploaddir . $f_chica;
move_uploaded_file($_FILES['foto_chica']['tmp_name'], $uploadfile);
/*chmod($uploadfile, 0755);*/
$uploadfile = $uploaddir . $f_grande;
move_uploaded_file($_FILES['foto_grande']['tmp_name'], $uploadfile);
/*chmod($uploadfile, 0755);*/
}
break;
Y esto es lo que me aparece en el navegador:
C:\PHP\uploadtemp\phpDD.tmp C:\PHP\uploadtemp\phpDD.tmp C:\PHP\uploadtemp\phpDE.tmp C:\PHP\uploadtemp\phpDE.tmp
Warning: move_uploaded_file(../images/5_chica.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\peatonal\admin\index.php on line 166
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\PHP\uploadtemp\phpDD.tmp' to '../images/5_chica.jpg' in C:\Inetpub\wwwroot\peatonal\admin\index.php on line 166
Warning: move_uploaded_file(../images/5.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\peatonal\admin\index.php on line 169
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\PHP\uploadtemp\phpDE.tmp' to '../images/5.jpg' in C:\Inetpub\wwwroot\peatonal\admin\index.php on line 169
Como ves no hay errores en el código, es algún problemas de permisos en Windows, porque esto en el server Linux corre bien.
Saludos