Search code examples
phplaravellaravel-5thephpleague

Laravel flysystem ftpd adapter


I want to use the ftpd Adapter in Laravel to access a Synology NAS, which seems to need this specific adapter https://github.com/thephpleague/flysystem/issues/305, but I get the error

Driver [Ftpd] is not supported.

The file is there:

vendor/league/flysystem/src/Adapter/Ftpd.php

Do I have to register anything that I can use it?

I tried to use it in filesystems.php like this

    'diskstation' => [
        'driver'   => 'Ftpd',
        'host'     => 'ftp.domain.com',
        'username' => '****',
        'password' => '****',

        // Optional FTP Settings...
        'port'     => 21,
        'root'     => '',
        'passive'  => true,
        'ssl'      => false,
        'timeout'  => 10,
    ],

Solution

  • It looks like laravel does not support ftpd out of the box as you can see here:

    https://github.com/laravel/framework/blob/5.4/src/Illuminate/Filesystem/FilesystemManager.php#L13

    It imports a few of the Flysystem drivers, but not the ftpd one.

    However you can create custom drivers like is shown here in the docs. The ftpd driver is already build for flysystem so you just need to import it in laravel via this method.