How to get the uploaded file list ??

32 views
Skip to first unread message

R.

unread,
Jun 16, 2017, 8:26:08 AM6/16/17
to jQuery-File-Upload
Hello,

I put the "Basic Plus UI version" of JQuery File Upload and it works : I can pick a file and upload it on my server. I can delete some of them using the "delete" button, it works. When I reload the page, the uploaded files are shows. Apparently, everything is fine.

But I can't manage to get the list of uploaded files (filenames) and I can't find anywhere how to get it. So I tried to make the list manually like this : 
$(document).ready(function() {
var uploaded_files = new Array();
$('#fileupload')
   
.bind('fileuploadcompleted', function (e, data) { // add file to uploaded_files variable
               
if (typeof data.files !== 'undefined') uploaded_files.push(data.files);
                console
.log(uploaded_files);
   
})
.bind('fileuploaddestroy', function (e, data) { // remove file from uploaded_files variable
        console
.log(data);
/* what should I do there ?? I don't understand */
});
});

When I add a file, the variable uploaded_files is updated, ok. But I can't understand what I should do precisely when a file is deleted...
Maybe there is something easier to do to get this list of uploaded files ? 

Could you help me ??

Many thanks in advance,

R.
Reply all
Reply to author
Forward
0 new messages