1

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,
    ],
John Slegers
  • 45,213
  • 22
  • 199
  • 169
ndberg
  • 3,391
  • 1
  • 21
  • 36

1 Answers1

3

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.

Björn
  • 5,696
  • 1
  • 24
  • 34
  • 1
    Thanks, that worked.. The ftpd class is already there, so I could just make a service provider and add this in the boot() method: Storage::extend('Ftpd', function ($app, $config) { return new Filesystem(new Ftpd($config)); }); – ndberg Feb 28 '17 at 12:12