PHPackages                             karelwintersky/arris.php-file-download - 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. karelwintersky/arris.php-file-download

ActiveLibrary

karelwintersky/arris.php-file-download
======================================

A library to help with creating downloads for files in PHP

2.0.0(7mo ago)0449MITPHPPHP ^8.0

Since Oct 26Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/ArrisFramework/Arris.Toolkit.FileDownload)[ Packagist](https://packagist.org/packages/karelwintersky/arris.php-file-download)[ RSS](/packages/karelwintersky-arrisphp-file-download/feed)WikiDiscussions master Synced today

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

PHP File Download
=================

[](#php-file-download)

A class to help with creating downloads for files in PHP.

Tip
---

[](#tip)

If you can use direct downloads, you should just use them. This class is for providing downloads of files out of PHP, for example if you want to provide a download to a temporarily created file.

Usage
=====

[](#usage)

The examples assume, that you have included the namespace:

```
use Arris\Toolkit\FileDownload;
```

Create a download for a file on your file system
------------------------------------------------

[](#create-a-download-for-a-file-on-your-file-system)

```
$fileDownload = FileDownload::createFromFilePath("/path/to/file.pdf");
$fileDownload->sendDownload("download.pdf");
```

Create a download for a file via file pointer
---------------------------------------------

[](#create-a-download-for-a-file-via-file-pointer)

```
$file = /* your file, somewhere opened with fopen() or tmpfile(), etc.. */;
$fileDownload = new FileDownload($file);
$fileDownload->sendDownload("download.pdf");
```

Create a download for a file via content
----------------------------------------

[](#create-a-download-for-a-file-via-content)

```
$content = "This is the content of the file:";
$fileDownload = FileDownload::createFromString($content);
$fileDownload->sendDownload("download.txt");
```

For example, you can create downloads for PDF files, generated by Zend (or any other library):

```
$pdf = new Zend_Pdf();
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;

/* draw content in the pdf ... */

$fileDownload = FileDownload::createFromString($pdf->render());
$fileDownload->sendDownload("download.pdf");
```

NB
--

[](#nb)

Если в методе `sendDownload()` опустить имя файла - оно будет равно имени файла, которое передали конструктору.

Есть нюанс: если файл создается из строки: `createFromString()` - отсутствие аргумента в `sendDownload()` предписывает скачать файл с пустым именем. Последствия неизвестны.

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance62

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~168 days

Recently: every ~181 days

Total

7

Last Release

231d ago

Major Versions

0.9.1 → 1.0.02023-08-07

1.99.1 → 2.0.02025-08-03

PHP version history (4 changes)0.9PHP &gt;7.2

1.1.0PHP &gt;7.4

1.99.1PHP ^7.4 | ^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d4a5bbb45fc701f595e17c74b94658126704ebc4eafb3fb1aa8bc613cdcbbbd?d=identicon)[KarelWintersky](/maintainers/KarelWintersky)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/karelwintersky-arrisphp-file-download/health.svg)

```
[![Health](https://phpackages.com/badges/karelwintersky-arrisphp-file-download/health.svg)](https://phpackages.com/packages/karelwintersky-arrisphp-file-download)
```

PHPackages © 2026

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