Title: Run a command when elFinder loaded
Tags: elfinder
Question: I want to open "Upload files" dialog automatically when elFinder loaded.
I found this function was run after elFinder loaded, but I can't bind or call upload command.
$('selector').elfinder({
// options ...
handlers : {
load : function(event, elfinder) {
console.log(elfinder);
}


Here is another answer: Execute the upload command after executing the first open command.
$('selector').elfinder({
// options ...
handlers : {
load : function(event, elfinder) {
elfinder.one('open', function() {
elfinder.exec('upload');
});
}

Here is another answer: I encountered the same problem, there isn't documentation about this, so after some messing around this was my solution.
First you need to get the instance of elfinder:
elf1 = $('#fexplorer').elfinder({...options...});
elf=elf1.elfinder('instance');
When you have it you can call any command this way:
elf.exec('upload');

Here is another answer: You should ask for the command and the execute it!.
it works for elFinder (2.1.46)
var _elFinder = $("#finder").elfinder(
{url : '/processAdmin/connector/' + idProceso,
lang: 'es',
width:'auto',
height:200,
commands: ['rename','upload'],
ui:[],
disabled:['extract', 'archive', 'mkdir'],
sortStickFolders:true,
resizable:false,
customData : {'numDocumento':numDocument}
},
function(fm, extraObj) {
// `init` event callback function
setTimeout(function() {
elf = _elFinder.elfinder('instance');
cmd = elf._commands['upload'];
cmd.exec();
}, 500);}

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 3, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:07/16/13', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<elfinder>', 'Title': 'Run a command when elFinder loaded', 'ViewCount': 1975, 'id': 17673563, 'user_AboutMe': None, 'user_AccountId': 2892132.0, 'user_DisplayName': 'Ngoc Luong', 'user_Reputation': 11.0, 'user_Views': 4.0, 'user_id': 2480667.0}}