0

I want to upload a file in a sftp account with the package https://github.com/thephpleague/flysystem-sftp

But i don't know really how to achieve the storage of the file.

Hope someone could help me and show me how to store the $file

Here my controller :

$file = Excel::create('' . $date . '' , function($excel) use ($licencies) {
        $excel->sheet('Excel', function($sheet) use ($licencies)
        {
            $sheet->fromArray($licencies);

        });

    })->string('xlsx');

    //Storage::disk('sftp')->put('Licences2018 - FFRXIII : ' . $date . '', $file);

    $adapter = new SftpAdapter([
        'driver'     => 'sftp',
        'host'       => '',
        'port'       => 22,
        'username'   => '',
        'password'   => '',
        'root'       => '/DIRECTORY',
        'timeout'    => 10
    ]);

    $filesystem = new Filesystem($adapter);

    $adapter->connect();

    dd($adapter);
Mathieu Mourareau
  • 1,140
  • 2
  • 23
  • 47
  • You could look at using something like: https://github.com/jailtonsc/sftp-laravel. – Rwd Jul 13 '17 at 13:50
  • I don't understand... You don't know how to retrieve the file from your file system and put it in the remote host? – IlGala Jul 13 '17 at 14:43

0 Answers0