Os dejo el link : http://fineuploader.com/fine-uploader-basic-demo.html
El script:
Código HTML:
Ver original
<div id="fine-uploader-basic" class="btn btn-success">
</div>
<script>
$(document).ready(function() {
$fub = $('#fine-uploader-basic');
$messages = $('#messages');
var uploader = new qq.FileUploaderBasic({
button: $fub[0],
action: 'do-nothing.htm',
debug: true,
allowedExtensions: ['jpeg', 'jpg', 'gif', 'png'],
sizeLimit: 204800, // 200 kB = 200 * 1024 bytes
onSubmit: function(id, fileName) {
},
onUpload: function(id, fileName) {
$('#file-' + id).addClass('alert-info')
.html('<img src="client/loading.gif" alt="Initializing. Please hold."> ' +
'Initializing ' +
'“' + fileName + '”');
},
onProgress: function(id, fileName, loaded, total) {
if (loaded < total) {
progress = Math.round(loaded / total * 100) + '% of ' + Math.round(total / 1024) + ' kB';
$('#file-' + id).removeClass('alert-info')
.html('<img src="client/loading.gif" alt="In progress. Please hold."> ' +
'Uploading ' +
'“' + fileName + '” ' +
progress);
} else {
$('#file-' + id).addClass('alert-info')
.html('<img src="client/loading.gif" alt="Saving. Please hold."> ' +
'Saving ' +
'“' + fileName + '”');
}
},
onComplete: function(id, fileName, responseJSON) {
if (responseJSON.success) {
$('#file-' + id).removeClass('alert-info')
.addClass('alert-success')
'Successfully saved ' +
'“' + fileName + '”' +
} else {
$('#file-' + id).removeClass('alert-info')
.addClass('alert-error')
'Error with ' +
'“' + fileName + '”: ' +
responseJSON.error);
}
}
});
}
</script>
Creo que es en el action donde redirijo a mi .php que hará el upload, pero luego como le duevuelvo al script el ok o error????
Gracias!
 
 


