PHPackages                             softservlet/file-manager - 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. softservlet/file-manager

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

softservlet/file-manager
========================

081PHP

Since Apr 5Pushed 12y ago2 watchersCompare

[ Source](https://github.com/softservlet/file-storage)[ Packagist](https://packagist.org/packages/softservlet/file-manager)[ RSS](/packages/softservlet-file-manager/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

### Introduction

[](#introduction)

This package allows you to store files on any place, even local filesystem, or cloud CDN, FTP servers etc.

To accomplish this, a common way to describe a file location is needed.

Let's assume that you have a file stored on `/home/user/image.jpg`

We can tell about this file that it:

- has the `file` storage schema
- has the `/home/user/image.jpg` location

So, finally, we can describe it as `file:///home/user/image.jpg`

In conclusion, any file is always stored in a location that matches the following pattern of URI:

```
://[?][#]

```

For example if we store a file in openstack onbject storage we can have the following uri for it:

```
openstack://4281c348eaf83e70ddce0e07221c3d28

```

### Laravel integration

[](#laravel-integration)

Edit the `app/config/app.php` and add the following lines

```
'aliases' =>
	...
	'Storage' => 'Softservlet\FileManager\StorageFacade'

'providers' =>
	...
	'Softservlet\FileManager\FileManagerServiceProvider'

```

Usage
-----

[](#usage)

#### Store a file

[](#store-a-file)

Firstly we will instantiate a new `FileInterface` implementation object, which accpets as parameter the URI of the FileInterface.

By default, if the URI doesn not conaint a schema then the file:// schema will be interpreted

```
use Softservlet\FileManager\File\GenericFile;

//See Softservlet\FileManager\File\FileInterface
$file = new GenericFile('/home/user/image.jpg');
```

We will call then the `StorageFactory` class to store the file (for this Storage facade is used here).

The `store` method accepts as parameter an FileInterface and optionally an `StorageInterface` instance.

If the StorageInterface is not given, the file will be stored using the FilesystemStorage Driver.

```
$uri = Storage::store($file);
```

If you have an openstack storage implementation you will can call

```
$uri = Storage::store($file, new OpenstackStorage)
```

#### Retrieve a file

[](#retrieve-a-file)

We stored a file, now we want to retrieve it from the storage mechanism.

For this, we will use the `fileDescriptor()` method declared on `StorageInterface`, and wich is implemented by each storage driver.

It accepts as parameter an `FileInterface` and return an `FileDescriptorInterface`.

```
//we stored the file and got the $uri variable
$file = new GenericFile($uri);

$descriptor = Storage::fileDescriptor($file);

//See Softservlet\FileManager\File\FileDescriptorInterface
$contents = $descriptor->contents();
$mime = $descriptor->mime();
```

#### Delivering a file though http

[](#delivering-a-file-though-http)

To get an http url for accessing a file, you may use an implementation of `DeliveryInterface`.

Until now, there is an implementation for file stored with `FilesystemStorage` driver.

```
use Softservlet\FileManager\Deliver\LocalHttpDelivery;

$file = new GenericFile($uri);

$delivery = new LocalHttpDelivery();

$url = $delivery->httpUrl($file);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6908574?v=4)[softservlet](/maintainers/softservlet)[@softservlet](https://github.com/softservlet)

---

Top Contributors

[![mariusleu](https://avatars.githubusercontent.com/u/1437942?v=4)](https://github.com/mariusleu "mariusleu (15 commits)")

### Embed Badge

![Health badge](/badges/softservlet-file-manager/health.svg)

```
[![Health](https://phpackages.com/badges/softservlet-file-manager/health.svg)](https://phpackages.com/packages/softservlet-file-manager)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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