Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/09/2011, 16:10
Avatar de morfasto
morfasto
 
Fecha de Ingreso: julio-2011
Ubicación: Lima
Mensajes: 291
Antigüedad: 12 años, 9 meses
Puntos: 8
Aporte: Upload n Imagenes (redimensionadas) con Thumbnails (crop)

Hola, que tal?

Estuve trabajando en esto los ultimo dias y he podido lograr hacer para que mi codigo funcione para que uno pueda elegir la cantidad de fotos a subir, una vez que esten subidas, seleccionas en la foto que parte quieres que sea el thumbnail, se hace un crop y guarda el thumbnail tambien para cada foto.

Espero que pueda servirle a alguien.

Solo tiene un problema, el peso total de las fotos a subir no pueden exceder los 7 megas. Nose como solucionar esto, si identifica ese error, seria formidable.

seleccionar_cantidad_imagenes.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
head>
</
head>
<
body>
<
form method="post" action="elegir_imagenes.php">
  <
table border="0">
  <
tr>
    <
td align="right">Cantidad de Imagenes: </td>
    <
td>
        <
select name="imagenes" >
            <
option value="1">1</option>
            <
option value="2">2</option>
            <
option value="3">3</option>
            <
option value="4">4</option>
            <
option value="5">5</option>
        </
select>
    </
td>
    <
td></td>
  </
tr>
  <
tr>
    <
td align="right"></td>
    <
td>
    <
input name="continuar" type="submit" value="Continuar" />
    </
td>
  </
tr>
  </
table>
</
form>
</
body>
</
html
elegir_imagenes.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h2>Subir Foto</h2>
    <form name="photo" enctype="multipart/form-data" action="subir_imagenes.php" method="post">
    <?php
    $cantidad
=$_POST['imagenes'];
    for(
$i=1;$i<=$cantidad;$i++){
        echo 
"Foto <input type='file' name='image".$i."' size='30' /><br>";
    }
    
?>
    <input type="hidden" name="imagenes" value="<?php echo $cantidad?>">
    <input type="submit" name="upload" value="Upload" />
    </form>
</body>
</html>
continua...