Hola:
Tengo un código para crear una carpeta y almacenar varias fotos en ella. El problema es que me está haciendo la carpeta pero no guarda las fotos y el error esta en el nombre de las fotos que no se como ponerlo. Este es mi código:
Código PHP:
Ver original$ruta1 = '../../images/galeria/large/'.$codigo.'/';
$ruta2 = '../../images/galeria/thumbnails/'.$codigo.'/';
$i = 1;
foreach($_FILES as $value){
// Si la imagen fue subida correctamente
if ( $value['error'] == UPLOAD_ERR_OK ){
$image = new ResizePicture($value['tmp_name']);
$image->resize(444,420);
$w444 = $_FILES['foto']['name'];
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $_FILES['foto']['name'];
$image->save($ruta2.$w54);
$i++;
}
}
} else {
$i = 1;
foreach($_FILES as $value){
// Si la imagen fue subida correctamente
if ( $value['error'] == UPLOAD_ERR_OK ){
$image = new ResizePicture($value['tmp_name']);
$image->resize(444,420);
$w444 = $_FILES['foto']['name'];
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $_FILES['foto']['name'];
$image->save($ruta2.$w54);
$i++;
}
}
}
y este es el form donde se cargan:
Código HTML:
Ver original<form action="f_cargadas.php" name="form2" enctype="multipart/form-data" id="form2" method="post" > <th colspan="2">CARGAR FOTOS
</th> <td><input type="file" name="foto[]" id="foto1" /></td> <td><input type="file" name="foto[]" id="foto2" /></td> <td><input type="file" name="foto[]" id="foto3" /></td> <td><input type="file" name="foto[]" id="foto4" /></td> <td><input type="file" name="foto[]" id="foto5" /></td> <td><input type="file" name="foto[]" id="foto6" /></td> <td><input type="file" name="foto[]" id="foto7" /></td> <td><input type="file" name="foto[]" id="foto8" /></td> <td><input type="file" name="foto[]" id="foto9" /></td> <td colspan="2" align="center"><input name="cargar" type="submit" id="cargar" value="Cargar" /></td>
Por qué no puedo cargarlas???
Gracias