Elfinder: how to obtain file/folder info after move it

Created on 5 Feb 2019  路  4Comments  路  Source: Studio-42/elFinder

Hi,
I am using the "elfinder-minimal" version from nightly builds of this great software, because in normal release I had to disable many things that I do not use.
I would like to know how I can do a function ("bind" in the connector php) to get the name and the previous and current situation of a file/folder after moving it.
I have read the documentation and looked at many examples but I do not see how to obtain that data.

Thank you

question

All 4 comments

@adolforo Please check pastecommand results with an option bind.

'bind' => array('paste' => array(
    function($cmd, $result, $args, $elfinder, $volume) {
        $added = $result['added'];
        $removed = $result['removed'];
        // and your function...
    }
))

Thank you,
With this, I can work now.
One last question :
According to the documentation, the hash is calculated (in PHP) as:

$volumeId = 'l1_';
$path = 'path/to/target'; // without root path
$hash = $volumeId . rtrim(strtr(base64_encode($path), '+/=', '-_.'), '.');

According to this, the inverse (without "$volumeId") would be :

$path = base64_decode(strtr(substr($hash, strrpos($hash, '_')), '-_.', '+/='));
(although "rtrim" has no inverse)

But it does not work.

The one that works is

$path = base64_decode(strtr(substr($hash, strrpos($hash, '_')), '-.', '+='));
(the character "_" must be kept)

and also it works simply :

base64_decode(substr($hash, strrpos($hash, '_')));

What is the correct function?
regards

@adolforo You can use $volume->getPath($hash) to get path from hash.

Thank you
Much easier

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kagagnon picture kagagnon  路  3Comments

ahmadbadpey picture ahmadbadpey  路  4Comments

camgullo picture camgullo  路  3Comments

aktolu picture aktolu  路  3Comments

CodeLyokoXtEAM picture CodeLyokoXtEAM  路  3Comments