hola. estoy realizando mantenimiento de productos. utilizo la clase upload.class. en la interfaz del formulario esta rellenar los datos del producto y subir multiple imagens. pero al subirlo me da el siguiente error.
al colocar la otra instancia de upload.class (el codigo) para agregar la imagen redimensionada, me genera los siguientes errores:
Warning: getimagesize(C:\Windows\Temp\php4AAF.tmp) [function.getimagesize]: failed to open stream: No such file or directory in D:\AppServ\www\comenzando-desde-cero\repaso 9 (upload class)\ejemplo8 (cms galerias)\includes\class.upload.php on line 2877
Warning: fopen(C:\Windows\Temp\php4AAF.tmp) [function.fopen]: failed to open stream: No such file or directory in D:\AppServ\www\comenzando-desde-cero\repaso 9 (upload class)\ejemplo8 (cms galerias)\includes\class.upload.php on line 2936
Warning: move_uploaded_file(C:\Windows\Temp\php4AAF.tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\AppServ\www\comenzando-desde-cero\repaso 9 (upload class)\ejemplo8 (cms galerias)\includes\class.upload.php on line 3635
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Windows\Temp\php4AAF.tmp' to 'imagenes/\bdbeb06ac78a1880775d5448fe2df846.jpg' in D:\AppServ\www\comenzando-desde-cero\repaso 9 (upload class)\ejemplo8 (cms galerias)\includes\class.upload.php on line 3635
es es el codigo que me genera error:
Código PHP:
Ver original$imagen_thb = new Upload($file);
$imagen_thb->file_new_name_body = "thb_".$nombre_imagen;
$imagen_thb->image_resize = true;
$imagen_thb->image_x = 40;
$imagen_thb->Process('imagenes/');
$nombre_imagen = $imagen_thb->file_dst_name;
este es mi codigo completo.
Código PHP:
Ver original// empieza el 1er if.
if(!isset($_POST['editar'])) {
// defino la funcion agregar_producto() para agregar los productos.
agregar_producto($nombre_producto,$precio_producto,$detalle,$cantidad);
{
foreach($_FILES as $files => $file)
{
if(isset($file['name']) && !$file['error'] && $file['size']!=0) {
$f=1;
while($f)
{
$nombre_imagen = $f.$file['name'];
$f++;
else
$f=0;
}
// we instanciate the class for each element of $file
$handle = new Upload($file);
// then we check if the file has been uploaded properly
// in its *temporary* location in the server (often, it is /tmp)
if ($handle->uploaded)
{
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 380;
$handle->Process('imagenes/');
// creo una variable $nombre_imagen para enviar los nombres de las imagenes.
$nombre_imagen = $handle->file_dst_name;
$handle->clean();
}
$imagen_thb = new Upload($file);
$imagen_thb->image_resize = true;
$imagen_thb->image_x = 40;
$imagen_thb->Process('imagenes/');
$foto_imagen_thb = $imagen_thb->file_dst_name;
// pregunto si la variable a ingresar esta o no vacia.
if($nombre_imagen!="")
{
// hacemos el insert para la tabla puente que en este caso es galeria_producto
$sql_galeria_fotos = "INSERT INTO galeria_producto(idproducto,imagen,imagen_thb)VALUES('$idproducto','$nombre_imagen','$foto_imagen_thb')";
echo "<br />";
echo $sql_galeria_fotos;
echo "<br />";
if($_POST['pagina']!="")
{
$pagina = $_POST['pagina'];
$a = "&pagina=$pagina";
}
}
//header("Location:index.php?ok=1$a");
}
} // termina el bucle foreach.
}
}
saludos.