Libraries & Packages

League Flysystem: Filesystem Abstraction for PHP

Flysystem provides a consistent filesystem API for local storage and supported remote storage adapters.

Overview

Flysystem is a filesystem abstraction library for PHP. It allows an application to work with files through a common API while the underlying storage may be local or provided by a supported adapter.

Why use an abstraction

A storage abstraction can reduce coupling between business logic and a specific storage provider. It is useful for upload workflows, generated documents, backups and applications that may move files between local and remote storage.

Integration approach

Install the core package and the adapter required by the project. Configure storage credentials outside public source files, define allowed paths and use the library's operations for writing, reading, listing and deleting files.

Security considerations

Never trust user-supplied file paths or names. Validate file types and sizes, generate server-side names, restrict access to private storage and ensure that remote credentials have only the permissions the application needs.

Official resource

Flysystem documentation

Share this page Help other developers discover this resource.