How to I preload existing files and display them in the blueimp upload table?

后端 未结 4 814
轮回少年
轮回少年 2020-12-15 09:33

I am using the jquery-ui version of Blueimp upload and I like how I can format a table and display files that were just uploaded. But I\'d like to use it as a file manager a

4条回答
  •  一生所求
    2020-12-15 09:52

    If any of you looking at this is doing it in .NET, find this: (for me it is in application.js

    For a fairly recent version, there is a function

        // Load existing files:
    $.getJSON($('#fileupload form').prop('action'), function(files) {
    
    files = somethingelse;
    
        var fu = $('#fileupload').data('fileupload');
        fu._adjustMaxNumberOfFiles(-files.length);
        fu._renderDownload(files)
            .appendTo($('#fileupload .files'))
    
            .fadeIn(function() {
                // Fix for IE7 and lower:
                $(this).show();
            });
    });
    

    Inside the application.js I'm doing it for .NET though, and actually needed this gone.

    Then set your somethingelse to either your files or "" depending on what you want to show. If you remove the line files = somethingelse then it will preload all files from the folder.

提交回复
热议问题