The Flysystem PHP package, by Frank de Jonge, provides a powerful filesystem abstraction. There are also a lot of adapters available for working with SFTP, Azure, Google Cloud, Amazon S3 etc.
- Slim 4 - League Flysystem v2 (Slim 4 eBook)
- Slim 4 - League Flysystem v2 SFTP (Slim 4 eBook)
- Slim 4 - League Flysystem v3 (Slim 4 eBook Vol. 2)