Elfinder: select and return an array of selected files in elfinder

Created on 12 Mar 2016  路  4Comments  路  Source: Studio-42/elFinder

I'm using elFinder file manager. that is great and easy to use.

that has multi select files capability . but I want to use it for select some files then by pressing *_enter *_keyboard button, path of those files Be returned as an Javascript Array.

This is My code to initialize elFinder instance :

$('.add-item').on('click', function () {

    var filesArr = [];

    $('<div id="editor" />').dialogelfinder({
        url: './elfinder/php/connector.minimal.php',
        getFileCallback: function (file) {
            $('#editor').dialogelfinder('close');
            console.log(file.url);
        }
    });


});

that works when select one file but when user select multi files and press enter, all selected files opens for preview only.

How can I do that?

Most helpful comment

@ahmadbadpey for example

commandsOptions: {
    getfile: { multiple: true }
},
getFileCallback : function(file) {
    var urls = $.map(file, function(f) { return f.url; });
    console.log(urls);
},

All 4 comments

`commandsOptions:{
                getfile:{
                    onlyURL: true,
                    folders: false,
                    multiple: false,
                    oncomplete: "destroy"
                }
            },`

multiple: false,

@ahmadbadpey for example

commandsOptions: {
    getfile: { multiple: true }
},
getFileCallback : function(file) {
    var urls = $.map(file, function(f) { return f.url; });
    console.log(urls);
},

where I can find complete tutorial? I using codeigniter, bootstrap and I want to get selected url file to input text

Solved there #3027

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donShakespeare picture donShakespeare  路  4Comments

aktolu picture aktolu  路  3Comments

ramin-gitt picture ramin-gitt  路  3Comments

golee picture golee  路  3Comments

consc198 picture consc198  路  4Comments