Código HTML:
Ver original
<link rel="stylesheet" href="css_1/bootstrap.css"> <!-- Generic page styles --> <link rel="stylesheet" href="css_1/style.css"> <!-- Bootstrap styles for responsive website layout, supporting different screen sizes --> <link rel="stylesheet" href="css_1/bootstrap-responsive.css"> <!-- Bootstrap CSS fixes for IE6 --> <!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]--> <!-- Bootstrap Image Gallery styles --> <link rel="stylesheet" href="css_1/bootstrap-image-gallery.css"> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <link rel="stylesheet" href="css_1/jquery.fileupload-ui.css"> <!-- Shim to make HTML5 elements usable in older Internet Explorer versions --> <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!-- The file upload form used as target for the file upload widget --> <form id="fileupload" action="subir_img.php" method="POST" enctype="multipart/form-data"> <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> <div class="row fileupload-buttonbar"> <div class="span7"> <!-- The fileinput-button span is used to style the file input field as button --> <span class="btn btn-success fileinput-button"> <input type="file" name="file[]" multiple> </span> <button type="submit" class="btn btn-primary start"> </button> <button type="reset" class="btn btn-warning cancel"> </button> <button type="button" class="btn btn-danger delete"> </button> <input type="checkbox" class="toggle"> </div> <div class="span5"> <!-- The global progress bar --> <div class="progress progress-success progress-striped active fade"> </div> </div> </div> <!-- The loading indicator is shown during image processing --> <br> <!-- The table listing the files available for upload/download --> <script id="template-upload" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i++) { %} <tr class="template-upload fade"> {% if (file.error) { %} {% } else if (o.files.valid && !i) { %} <td> </td> <td class="start">{% if (!o.options.autoUpload) { %} <button class="btn btn-primary"> </button> {% } %}</td> {% } else { %} {% } %} <td class="cancel">{% if (!i) { %} <button class="btn btn-warning"> </button> {% } %}</td> </tr> {% } %} <!-- The template to display files available for download --> </script> <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included --> <!-- The Templates plugin is included to render the upload/download listings --> <!-- The Load Image plugin is included for the preview images and image resizing functionality --> <!-- The Canvas to Blob plugin is included for image resizing functionality --> <!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo --> <!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <!-- The basic File Upload plugin --> <!-- The File Upload image processing plugin --> <!-- The File Upload user interface plugin --> <!-- The localization script --> <!-- The main application script --> <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ --> <!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]-->
y con esto proceso los datos que me llegan
alomejor le falte uno que otra llave pero es por unas validaciones que hago de por ejemplo if(isset($_SESSION['log'])){
Código PHP:
Ver original
// ---------- MULTIPLE UPLOADS ---------- if($fi==""){ echo " Esta vacio"; exit; } // as it is multiple uploads, we will parse the $_FILES array to reorganize it into $files foreach ($fi as $k => $l) { foreach ($l as $i => $v) { $files[$i][$k] = $v; } } // now we can loop through $files, and feed each element to the class foreach ($files as $file) { if($file['type']==""){ echo "Esta vacio"; exit; } if(($file['type']!="image/png")&&($file['type']!="image/jpeg")&&($file['type']!="image/gif")){ echo "El tipo de archivo no es de los permitidos!"; exit; } // then we check if the file has been uploaded properly // in its *temporary* location in the server (often, it is /tmp) $foo = new Upload($file); if ($foo->uploaded) { // save uploaded image with a new name $foo->file_new_name_body = $ra; $foo->image_resize = true; $foo->image_convert = 'jpg'; $foo->image_x = 700; $foo->image_ratio_y = true; $foo->Process($dir_dest); if ($foo->processed) { } else { } $foo->file_new_name_body = $ra; $foo->image_resize = true; $foo->image_convert = 'jpg'; $foo->image_x = 80; $foo->image_ratio_y = true; $foo->Process($dir_dest3); if ($foo->processed) { } else { } // save uploaded image with a new name, // resized to 100px wide $foo->file_new_name_body = $ra; $foo->image_resize = true; $foo->image_convert = 'jpg'; $foo->image_x = 200; $foo->image_ratio_y = true; $foo->Process($dir_dest2); if ($foo->processed) { $query = "INSERT INTO imagenes(id_usuario,id_album,ruta_normal,ruta_thumb) VALUES ('$id_usuario','$id_album','$ra','$ra')"; echo "Imagen subida satisfactoriamente!"; }else{ echo "La imagen no pudo ser subida"; } $foo->Clean(); } else { echo 'error : ' . $foo->error; } }
eso es todo! no entiendo que sucede porq no sube mas de dos archivos