Search code examples
jqueryfilefile-uploaduploadblueimp

getting all uploaded files from blueimp file uploader


I use the blueimp file uploader to upload files to my webspace. How can I get all files in the list with their status?

I have a separate button which is outside the #fileupload divs and want to get an array or something like that with all files, which were uploaded.

Have I to iterate over the html code and parse the filename and status? I cannot believe that, but I also cannot find a function which returns me this information.


Solution

  • As I mentioned in my question I solved it with iterating over all elements in the list, looking for teh delete button and extracting the filename from the url of the delete button.

    var files = new Array();
    $("#fileupload td.delete button[data-type='DELETE']").each(function() {
        //get the basename of the url: http://abc/def/file.txt --> file.txt
        var name = $(this).attr("data-url").replace(/\\/g,'/').replace( /.*\//, '');
        files.push(name);
    });
    

    Does someone else has a better solution?