Como no cabía sigo aquí:
Pongo también el código javascript de inicialización de plupload.
Código HTML:
<script type="text/javascript">
// Convert divs to queue widgets when the DOM is ready
var subidosval = $('#subidos').val();
$(function() {
$("#uploader").pluploadQueue({
// General settings
runtimes : 'html5,flash',
url : 'includes/subemasfotos.php?id=' + <?php echo $_GET['id']; ?>,
max_file_size : '10000mb',
max_file_count: 50, // user can add no more then 50 files at a time
chunk_size : '10mb',
unique_names : false,
multiple_queues : false,
rename: false,
// Sort files
sortable: true,
// Specify what files to browse for
filters : [
{title : "Image files", extensions : "jpg,jpeg,gif,png"}
],
// Flash settings
flash_swf_url : 'js/plupload.flash.swf',
multipart : true,
multipart_params : {
'subidos' : subidosval
}
});
// Client side form validation
$('#masfotos').submit(function(e) {
var uploader = $('#uploader').plupload('getUploader');
// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('UploadComplete', function() {
if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
$('form')[0].submit();
}
});
uploader.start();
} else
alert('Debe subir un archivo por lo menos.');
return false;
});
});
</script>
y el html
Código HTML:
<form action="" method="post" name="masfotos" id="masfotos">
<div id="uploader"><p>You browser doesn't have Flash or HTML5 support.</p></div>
<input name="subidos" type="hidden" id="subidos" value="FilesUp">
</form>
Gracias