Hola me descargue el jquery file upload y lo instale para probarlo en mi localost con Xampp y con ese cargador de archivos uno puede subir cuantas imagenes quira...lo que sucede es que yo selecciono mas de dos imagenes y solo me carga nada mas dos! o sea solo me guarda en el directorio las dos primeras y el resto hace como si las cargo y todo pero en realidad no cargo nada, les muestro el codigo que uso:
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"> <!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button"> <span><i class="icon-plus icon-white"></i> Add files...
</span> <input type="file" name="file[]" multiple>
<button type="submit" class="btn btn-primary start"> <i class="icon-upload icon-white"></i> Start upload
<button type="reset" class="btn btn-warning cancel"> <i class="icon-ban-circle icon-white"></i> Cancel upload
<button type="button" class="btn btn-danger delete"> <i class="icon-trash icon-white"></i> Delete
<input type="checkbox" class="toggle"> <!-- The global progress bar -->
<div class="progress progress-success progress-striped active fade"> <div class="bar" style="width:0%;"></div> <!-- The loading indicator is shown during image processing -->
<div class="fileupload-loading"></div> <!-- The table listing the files available for upload/download -->
<table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
<script id="template-upload" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade"> <td class="name">{%=file.name%}
</td> <td class="size">{%=o.formatFileSize(file.size)%}
</td> {% if (file.error) { %}
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}
</span> {%=locale.fileupload.errors[file.error] || file.error%}
</td> {% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;">
</div></div> <td class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary"> <i class="icon-upload icon-white"></i> {%=locale.fileupload.start%}
{% } else { %}
{% } %}
<td class="cancel">{% if (!i) { %}
<button class="btn btn-warning"> <i class="icon-ban-circle icon-white"></i> {%=locale.fileupload.cancel%}
{% } %}
<!-- The template to display files available for download -->
<!-- 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 -->
<script src="http://blueimp.github.com/JavaScript-Canvas-to-Blob/canvas-to-blob.min.js"></script> <!-- 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";
}
// 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";
}
if(($file['type']!="image/png")&&($file['type']!="image/jpeg")&&($file['type']!="image/gif")){
echo "El tipo de archivo no es de los permitidos!";
}
// 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