PHPackages                             igorw/file-serve-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. igorw/file-serve-bundle

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

igorw/file-serve-bundle
=======================

Symfony2 Bundle for serving protected files.

v1.0.3(12y ago)166156.5k↓22.5%16[3 issues](https://github.com/igorw/IgorwFileServeBundle/issues)[2 PRs](https://github.com/igorw/IgorwFileServeBundle/pulls)MITPHPCI failing

Since Oct 16Pushed 9y ago9 watchersCompare

[ Source](https://github.com/igorw/IgorwFileServeBundle)[ Packagist](https://packagist.org/packages/igorw/file-serve-bundle)[ RSS](/packages/igorw-file-serve-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

FileServeBundle
===============

[](#fileservebundle)

About
-----

[](#about)

The FileServeBundle allows you to serve files that are not publicly available, such as private attachments.

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

[](#installation)

Add the bundle to your `composer.json`:

```
{
    "require": {
        "igorw/file-serve-bundle": "~1.0"
    }
}
```

Add the FileServeBundle to your application's kernel:

```
public function registerBundles()
{
    $bundles = array(
        // ...
        new Igorw\FileServeBundle\IgorwFileServeBundle(),
        // ...
    );
    // ...
}
```

Usage
-----

[](#usage)

Use the `igorw_file_serve.response_factory` service to create a FileServe response. The path is relative to the `app` directory by default.

```
$response = $this->get('igorw_file_serve.response_factory')->create('../VERSION', 'text/plain');
```

You can also pass a set of options as the third parameter of the `create`method.

```
$options = array(
    'serve_filename' => 'VERSION.txt',
    'absolute_path' => true,
    'inline' => false,
);

$response = $this->get('igorw_file_serve.response_factory')
    ->create('../VERSION', 'text/plain', $options);
```

- **serve\_filename:** Filename the browser downloads the file as.
- **absolute\_path:** If enabled, the bundle will ignore the `base_dir` option and use the provided filename as an absolute path.

You can configure the factory used, for example to use a nginx XSendfile response factory:

```
igorw_file_serve:
    factory: sendfile     # The default value is "php"
```

You can also configure the base directory:

```
igorw_file_serve:
    base_dir: /files/dir     # The default value is "%kernel.root_dir%"
```

By default, this bundle does a `file_exists` check when creating a response object. Recent nginx versions require relative paths, in which case the paths inside of PHP are not actual physical paths. Use the `skip_file_exists`setting to disable the check.

```
igorw_file_serve:
    skip_file_exists: true  # The default value is false
```

### Supported factories

[](#supported-factories)

- `php`
- `sendfile` (nginx)
- `xsendfile` (apache)

Features
--------

[](#features)

- Incremental serving of large files
- Nginx [XSendfile](http://wiki.nginx.org/XSendfile)
- Apache [mod\_xsendfile](https://tn123.org/mod_xsendfile/)

Todo
----

[](#todo)

- Tests
- HTTP caching
- HTTP range requests
- Lighttpd XSendfile
- Handle PhpResponse getContent(), setContent()

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 77.6% 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.

###  Release Activity

Cadence

Every ~149 days

Total

4

Last Release

4515d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3afcc18d00fff840775bbf9570b3e9cd3997ca4820b9bfb14caf6da3ae580370?d=identicon)[igorw](/maintainers/igorw)

---

Top Contributors

[![igorw](https://avatars.githubusercontent.com/u/88061?v=4)](https://github.com/igorw "igorw (45 commits)")[![inmarelibero](https://avatars.githubusercontent.com/u/254808?v=4)](https://github.com/inmarelibero "inmarelibero (3 commits)")[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (2 commits)")[![clalarco](https://avatars.githubusercontent.com/u/1417822?v=4)](https://github.com/clalarco "clalarco (2 commits)")[![saidul](https://avatars.githubusercontent.com/u/357908?v=4)](https://github.com/saidul "saidul (2 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (1 commits)")[![billybednar](https://avatars.githubusercontent.com/u/1000201?v=4)](https://github.com/billybednar "billybednar (1 commits)")

---

Tags

file systemsendfile

### Embed Badge

![Health badge](/badges/igorw-file-serve-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/igorw-file-serve-bundle/health.svg)](https://phpackages.com/packages/igorw-file-serve-bundle)
```

###  Alternatives

[crysalead/dir

Recursive directory scanner to locate directories and/or files in a file system

13214.5k4](/packages/crysalead-dir)[aimeos/ai-filesystem

Aimeos file system layer extension

1029.9k1](/packages/aimeos-ai-filesystem)

PHPackages © 2026

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