Skip to main content

Flysystem SFTP ( Notes on Remote File Storage for Drupal CMS)

https://www.drupal.org/project/flysystem_sftp

Provides an SFTP plugin for Flysystem.  Useful when setting up a custom Media type that can be stored on a remote system. (Remote Linux).

This is a quick proof of concept showing how Drupal Media files can be configured to use a remote file system. Flysystem SFTP can provide a mechanism for low-budget Content Delivery Network (CDN) for Drupal media. This is a helpful tool if you need to proxy Intranet media through Rich Text HTML email.
 

Image
SFTP File Tools
Image
Remote File System

The connection string for the remote file service is kep in Drupal's site settings.php file.
 

Image
SFTP File Settigns


# sites/default/settings.php 
$schemes = [
 'cdnsftp' => [
   'driver' => 'sftp',
   'config' => [
     'host' => '',
     'username' => '',
     'password' => '',
     'port' => 22,
     'root' => '/images/',
   ],
   'public' => TRUE,
 ],
]; 
$settings['flysystem'] = $schemes;

Machine name: flysystem_sftp
Version: 8.x-1.2

Requires:

  • Flysystem
  • File
  • Field
  • Image