Closed crinelll closed 11 years ago
finally I found the solution:
//Load files
$.ajax({
url: $("#"+div_id + " input#ajax_uploader_url").val(),
dataType: 'json',
success : function(data) {
var rows = $();
var fu = $('#'+div_id).data('blueimpFileupload');
$.each(data.files, function (index, file) {
fu._adjustMaxNumberOfFiles(-1);
var row = $('<tr class="template-download fade">' +
Hi, I have succesfully implemented the uploader using on a codeigniter project with PHPTAL.
Because I was using PHPTAL I had to giveup the default templates used by the uploader... so I defined my own templates when initializing the uploader... something like this:
var div_id = $("#div_id").val(); $('#'+div_id).fileupload({ maxNumberOfFiles: $("#max_number_of_files").val(), filesContainer: $('#upload_files_container'), uploadTemplateId: null, downloadTemplateId: null, uploadTemplate: function (o) { var rows = $(); $.each(o.files, function (index, file) { var row = $('
some fields are variables, because I use the same uploader view for more than one page...
The problem is when loading previously uploaded pictures... my fist try was to use an AJAX that looks like this:
The problem is that with this AJAX, I have problems with the maxNumberOfFiles option... it is not incremented/decremented correctly if I allready have an uploaded file...
example: for this uploder instance the maxNumberOfFiles = 3...if I have a previously uploded file, the maxNumberOfFiles should be 2, but it remains 3, it is not decremented, do it will let me upload 3 more files...
Please help ! I'm struggling with this for 2 days now...