PHPackages                             league/flysystem-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. league/flysystem-bundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

league/flysystem-bundle
=======================

Symfony bundle integrating Flysystem into Symfony applications

3.7.0(2mo ago)40131.4M↓38.6%83[5 issues](https://github.com/thephpleague/flysystem-bundle/issues)[1 PRs](https://github.com/thephpleague/flysystem-bundle/pulls)20MITPHPPHP &gt;=8.2CI passing

Since Apr 9Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/thephpleague/flysystem-bundle)[ Packagist](https://packagist.org/packages/league/flysystem-bundle)[ RSS](/packages/league-flysystem-bundle/feed)WikiDiscussions 3.x Synced 1w ago

READMEChangelog (10)Dependencies (44)Versions (37)Used By (20)

flysystem-bundle
================

[](#flysystem-bundle)

[![Packagist Version](https://camo.githubusercontent.com/07f90e74a8335074c43d6e533f77400ddabcc7583d0e3312c3dee68cfff7474d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65616775652f666c7973797374656d2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/flysystem-bundle)[![Software license](https://camo.githubusercontent.com/d10fac4ebbb0ad6a375c6cdfe5a665e9e9ea356859ffd38f1aa36018877f11ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7468657068706c65616775652f666c7973797374656d2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

flysystem-bundle is a Symfony bundle integrating the [Flysystem](https://flysystem.thephpleague.com)library into Symfony applications.

It provides an efficient abstraction for the filesystem in order to change the storage backend depending on the execution environment (local files in development, cloud storage in production and memory in tests).

> Note: you are reading the documentation for flysystem-bundle 3.0, which relies on Flysystem 3.
> If you use Flysystem 1.x, use [flysystem-bundle 1.x](https://github.com/thephpleague/flysystem-bundle/tree/1.x).
> If you use Flysystem 2.x, use [flysystem-bundle 2.x](https://github.com/thephpleague/flysystem-bundle/tree/2.x).
> Read the [Upgrade guide](UPGRADE.md) to learn how to upgrade.

Installation
------------

[](#installation)

flysystem-bundle 3.x requires PHP 8.0+ and Symfony 5.4+.

> If you need support for a lower PHP/Symfony version, consider using [flysystem-bundle 2.x](https://github.com/thephpleague/flysystem-bundle/tree/2.x) which support Flysystem 3.x and older PHP/Symfony versions.

You can install the bundle using Symfony Flex:

```
composer require league/flysystem-bundle

```

Basic usage
-----------

[](#basic-usage)

The default configuration file created by Symfony Flex provides enough configuration to use Flysystem in your application as soon as you install the bundle:

```
# config/packages/flysystem.yaml

flysystem:
    storages:
        default.storage:
            local:
                directory: '%kernel.project_dir%/var/storage/default'
```

This configuration defines a single storage service (`default.storage`) based on the local adapter and configured to use the `%kernel.project_dir%/var/storage/default` directory.

For each storage defined under `flysystem.storages`, an associated service is created using the name you provide (in this case, a service `default.storage` will be created). The bundle also creates a named alias for each of these services.

This means you can inject the storage services in your services and controllers like this:

**1) Using service autowiring:** typehint your service/controller argument with `FilesystemOperator` and use the `#[Target]` attribute to select the storage by name:

```
use League\Flysystem\FilesystemOperator;

class MyService
{
    public function __construct(
        #[Target('default.storage')] private FilesystemOperator $storage,
    ) {
    }

    // ...
}
```

Instead of using the `#[Target]` attribute, you can also typehint your service/controller argument with `FilesystemOperator` and use the camelCase version of your storage name as the variable name. However, this practice is discouraged and won't work in future Symfony versions:

```
use League\Flysystem\FilesystemOperator;

class MyService
{
    private FilesystemOperator $storage;

    // The variable name $defaultStorage matters: it needs to be the
    // camelCase version of the name of your storage (foo.bar.baz -> fooBarBaz)
    public function __construct(FilesystemOperator $defaultStorage)
    {
        $this->storage = $defaultStorage;
    }

    // ...
}
```

**2) Using manual service registration:** in your services, inject the service that this bundle creates for each of your storages following the pattern `'flysystem.adapter.'.$storageName`:

```
# config/services.yaml
services:
    # ...

    App\MyService:
        arguments:
            $storage: @flysystem.adapter.default.storage
```

Once you have a FilesystemOperator, you can call methods from the [Filesystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)to interact with your storage.

If you need to transfer files between the local filesystem and one of your configured storages, the bundle also provides two console commands:

```
bin/console flysystem:push   [remote-destination]
bin/console flysystem:pull   [local-destination]
```

The `` argument is the configured Flysystem storage name (for example `default.storage`), not the adapter type. When the destination is omitted, the basename of the source path is used.

Full documentation
------------------

[](#full-documentation)

1. [Getting started](docs/1-getting-started.md)
2. Cloud storage providers: [AsyncAws S3](docs/2-cloud-storage-providers.md#asyncaws-s3), [AWS SDK S3](docs/2-cloud-storage-providers.md#aws-sdk-s3), [Azure](docs/2-cloud-storage-providers.md#azure), [Google Cloud Storage](docs/2-cloud-storage-providers.md#google-cloud-storage), [DigitalOcean Spaces](docs/2-cloud-storage-providers.md#digitalocean-spaces), [Scaleway Object Storage](docs/2-cloud-storage-providers.md#scaleway-object-storage)
3. [Interacting with FTP and SFTP servers](docs/3-interacting-with-ftp-and-sftp-servers.md)
4. [Using a lazy adapter to switch storage backend using an environment variable](docs/4-using-lazy-adapter-to-switch-at-runtime.md)
5. [Creating a custom adapter](docs/5-creating-a-custom-adapter.md)
6. [MongoDB GridFS](docs/6-gridfs.md)
7. [WebDAV](docs/7-webdav.md)
8. [BunnyCDN](docs/8-bunnycdn.md)

- [Security issue disclosure procedure](docs/A-security-disclosure-procedure.md)

Security Issues
---------------

[](#security-issues)

If you discover a security vulnerability within the bundle, please follow [our disclosure procedure](docs/A-security-disclosure-procedure.md).

Backward Compatibility promise
------------------------------

[](#backward-compatibility-promise)

This library follows the same Backward Compatibility promise as the Symfony framework:

> *Note*: many classes in this bundle are either marked `@final` or `@internal`. `@internal` classes are excluded from any Backward Compatibility promise (you should not use them in your code) whereas `@final` classes can be used but should not be extended (use composition instead).

###  Health Score

76

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity70

Solid adoption and visibility

Community49

Growing community involvement

Maturity84

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~61 days

Total

36

Last Release

47d ago

Major Versions

1.6.0 → 2.0.02021-01-17

1.6.1 → 2.4.02022-09-12

2.4.0 → 3.0.02022-09-12

2.x-dev → 3.2.02023-08-21

PHP version history (4 changes)1.0.0-alphaPHP &gt;=7.1

2.0.0PHP &gt;=7.2

3.0.0PHP &gt;=8.0

3.6.2PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/534693?v=4)[Frank de Jonge](/maintainers/frankdejonge)[@frankdejonge](https://github.com/frankdejonge)

![](https://www.gravatar.com/avatar/bf5cd47f55eb8a801bab7ce80901bada792f1d5fef54678852b118e189e92606?d=identicon)[tgalopin](/maintainers/tgalopin)

---

Top Contributors

[![tgalopin](https://avatars.githubusercontent.com/u/1651494?v=4)](https://github.com/tgalopin "tgalopin (114 commits)")[![Lustmored](https://avatars.githubusercontent.com/u/2358046?v=4)](https://github.com/Lustmored "Lustmored (25 commits)")[![maxhelias](https://avatars.githubusercontent.com/u/12966574?v=4)](https://github.com/maxhelias "maxhelias (22 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (12 commits)")[![Radiergummi](https://avatars.githubusercontent.com/u/6115429?v=4)](https://github.com/Radiergummi "Radiergummi (7 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (7 commits)")[![airnzspijkn](https://avatars.githubusercontent.com/u/138830141?v=4)](https://github.com/airnzspijkn "airnzspijkn (5 commits)")[![JohnstonCode](https://avatars.githubusercontent.com/u/10222719?v=4)](https://github.com/JohnstonCode "JohnstonCode (5 commits)")[![rvanlaak](https://avatars.githubusercontent.com/u/2707563?v=4)](https://github.com/rvanlaak "rvanlaak (4 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (4 commits)")[![guillaume-sainthillier](https://avatars.githubusercontent.com/u/5052984?v=4)](https://github.com/guillaume-sainthillier "guillaume-sainthillier (3 commits)")[![syffer](https://avatars.githubusercontent.com/u/4788060?v=4)](https://github.com/syffer "syffer (3 commits)")[![nspyke](https://avatars.githubusercontent.com/u/901747?v=4)](https://github.com/nspyke "nspyke (3 commits)")[![Tofandel](https://avatars.githubusercontent.com/u/6115458?v=4)](https://github.com/Tofandel "Tofandel (3 commits)")[![qdequippe](https://avatars.githubusercontent.com/u/3193300?v=4)](https://github.com/qdequippe "qdequippe (2 commits)")[![beganovich](https://avatars.githubusercontent.com/u/13711415?v=4)](https://github.com/beganovich "beganovich (2 commits)")[![freezy-sk](https://avatars.githubusercontent.com/u/661637?v=4)](https://github.com/freezy-sk "freezy-sk (2 commits)")[![michealmouner](https://avatars.githubusercontent.com/u/2089749?v=4)](https://github.com/michealmouner "michealmouner (2 commits)")[![VincentLanglet](https://avatars.githubusercontent.com/u/9052536?v=4)](https://github.com/VincentLanglet "VincentLanglet (1 commits)")[![devnix](https://avatars.githubusercontent.com/u/1777519?v=4)](https://github.com/devnix "devnix (1 commits)")

---

Tags

symfonyfilesystembundleFlysystem

### Embed Badge

![Health badge](/badges/league-flysystem-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/league-flysystem-bundle/health.svg)](https://phpackages.com/packages/league-flysystem-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
