Hola a todos, este es el avanze segun lo sugerido por Nefertiter
formularioBlob.php
Código php:
Ver original<!-- <html>
<head>
<title>Imagen a Blob</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form name="frmimage" method="post" enctype="multipart/form-data" action="include/insertarBlob.php">
<table>
<tr> <td align="right" width="19%">Foto 1:</td>
<td width="61%"><input type="file" size="51" name="foto[]"></td>
</tr>
<tr> <td align="right" width="19%">Foto 2:</td>
<td width="61%"><input type="file" size="51" name="foto[]"></td>
</tr>
<tr> <td align="right" width="19%">Foto 3:</td>
<td width="61%"><input type="file" size="51" name="foto[]"></td>
</tr>
</table>
<center>
<table border=0 cellpadding=15>
<td><input type="submit" name="enviar" value="Guardar"></td>
<td><input type="reset" name="reset" value="Limpiar"></td>
</table>
</form>
</body>
</html>
-->
insertarBlob.php
Código php:
Ver original<!-- <?php
$postback = (isset($_POST["enviar"])) ?
true : false; if($postback)
{
include('conec.php');
conectarse();
$mimetypes = array("image/jpeg", "image/pjpeg", "image/gif", "image/png"); for($i=0;$i<=count($_FILES['foto']);$i++) {
//obtener del array FILES (superglobal) los datos del binario...nombre, tipo, tamaño
$size = $_FILES["foto"]["size"][$i]; //linea 12
$name = $_FILES["foto"]["name"][$i]; //linea 13
$type = $_FILES["foto"]["type"][$i]; //linea 14
die("El archivo que subiste no es una imagen válida"); //archivo temporal (ruta y nombre)
$tmp_name = $_FILES["foto"]["tmp_name"][$i];
//leer el archivo temporal
$fp = fopen($tmp_name,"rb"); //filesize: obtiene el tamaño del archivo
//fread: lectura de archivos segura con material binario
//escapa una cadena insertando barras "\"
}
$sql1 = "INSERT INTO catalogo(id,foto,foto1,foto2) VALUES('','".$tfoto[0]."','".$tfoto[1]."','".$tfoto[2]."')"; //ojo el campo id es autoincrement
echo "<h2>Foto guardada correctamente en la base de datos</h2>";
}
?> -->
pero me sale estos msjes de error:
Notice: Undefined offset: 3 in /home/nando/public_html/include/insertarBlob.php on line 12
Notice: Undefined offset: 3 in /home/nando/public_html/include/insertarBlob.php on line 13
Notice: Undefined offset: 3 in /home/nando/public_html/include/insertarBlob.php on line 14
El archivo que subiste no es una imagen válida