Search code examples
elfinder

How do I link into a specific volume and path in elfinder?


Elfinder has 2 parts to a complete path. The format is basically driveHash_pathHash. To link to a file I need to use something like this. http://example.com/elfinder#driveHash_pathHash

I've figured out how to convert my/file/path to pathHash from posts like this https://github.com/Studio-42/elFinder/wiki/Getting-encoded-hash-from-the-path

How do I get the drive hash? (referred to as volumeID if you follow that link.)


Solution

  • The driveHash ain't no hash at all. It's just a string and a number. So it can't be encoded and decoded like the pathHash. The work-around for dealing with this - is to define it myself for elfinder in the config options.

    'disks' => [
    
        'HD' => [
            'glideURL' => '/glide/HD',
            'driverId' => 'HD',
            'id' => '69',
        ],
    ...
    

    Will make a url with #elf_HD69_Lw where:

    1. elf_ just get's added by elfinder.
    2. HD69_ is the concatination of the driverId and id that I set in the config.
    3. Lw is the pathHash for /