PHPackages                             conorsmith/fileresponse - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. conorsmith/fileresponse

AbandonedLibrary[HTTP &amp; Networking](/categories/http)

conorsmith/fileresponse
=======================

Wrapper for responses in the Symfony HttpFoundation component.

v0.3.1(11y ago)018MITPHP

Since Sep 5Pushed 11y ago1 watchersCompare

[ Source](https://github.com/conorsmith/fileresponse)[ Packagist](https://packagist.org/packages/conorsmith/fileresponse)[ RSS](/packages/conorsmith-fileresponse/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

File Response
=============

[](#file-response)

[![Build Status](https://camo.githubusercontent.com/4dd8b4306977021c0ab2cf1a8c930a890eda00ae074620da082f2622cc92652c/68747470733a2f2f7472617669732d63692e6f72672f636f6e6f72736d6974682f66696c65726573706f6e73652e737667)](https://travis-ci.org/conorsmith/fileresponse)

This package wraps the `Response` object of the [Symfony HttpFoundation component](http://symfony.com/doc/current/components/http_foundation/introduction.html) for file output. The concrete classes allow you to avoid the boilerplate involved in setting up a file download response.

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "conorsmith/fileresponse": "0.3.*"
    }
}

```

Available File Types
--------------------

[](#available-file-types)

- CsvFileResponse (text/csv)
- GifFileResponse (image/gif)
- JpegFileResponse (image/jpeg)
- PdfFileResponse (application/pdf)
- PngFileResponse (image/png)
- TextFileResponse (text/plain)
- ZipFileResponse (application/zip)

Examples
--------

[](#examples)

```
use ConorSmith\FileResponse\TextFileResponse;

$response = new TextFileResponse('example.txt', 'This is the text file\'s contents');
$response->send();

```

You can use the abstract `FileResponse` class to create your own custom file responses.

```
use ConorSmith\FileResponse\FileResponse;

class NsfwJpegFileResponse extends FileResponse
{
    public function __construct($filename, $content)
    {
        parent::__construct($filename, $content, array(
            'Content-Type' => 'image/jpeg',
            'X-Content-NSFW' => true,
        ));
    }
}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

4272d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/458602f4f8bdb0bd796e53ba182381fcd9c6637c3089ea3dbf9c2f0b1c417165?d=identicon)[conorsmith](/maintainers/conorsmith)

---

Top Contributors

[![conorsmith](https://avatars.githubusercontent.com/u/1684753?v=4)](https://github.com/conorsmith "conorsmith (25 commits)")

---

Tags

httpresponsefiledownload

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/conorsmith-fileresponse/health.svg)

```
[![Health](https://phpackages.com/badges/conorsmith-fileresponse/health.svg)](https://phpackages.com/packages/conorsmith-fileresponse)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M274](/packages/fig-http-message-util)[aplus/http

Aplus Framework HTTP Library

2311.6M10](/packages/aplus-http)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48619.2M541](/packages/nette-http)

PHPackages © 2026

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