PHPackages                             sharapeco/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. [File &amp; Storage](/categories/file-storage)
4. /
5. sharapeco/file-download

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

sharapeco/file-download
=======================

Make downloads for files in PHP

v1.0.0(6y ago)07MITPHPPHP ^5.4.0 || ^7.0CI failing

Since Sep 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/sharapeco/php-file-download)[ Packagist](https://packagist.org/packages/sharapeco/file-download)[ RSS](/packages/sharapeco-file-download/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

FileDownload class
==================

[](#filedownload-class)

- Make downloads from file
- Make downloads from content
- IE 9+ (ja), Safari 5+ (ja), Android 4.4+, Chrome, Firefox, Edge support

Usage
-----

[](#usage)

### From file

[](#from-file)

```
$filePath = '/path/to/file';

$download = sharapeco\HTTP\FileDownload::initWithFile($filePath);
$download->download('download-filename');
```

### From content

[](#from-content)

```
$content = 'This is the content of the file';

$download = sharapeco\HTTP\FileDownload::initWithContent($content);
$download->download('download-filename');
```

### Show PDF in browser with filename

[](#show-pdf-in-browser-with-filename)

```
$filePath = '/path/to/pdf';

$download = sharapeco\HTTP\FileDownload::initWithFile($filePath);
$download->showPDF('filename.pdf');
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aa0a053807078660f519d4bee9f5219653cd5d730c90b4decd0ab465d3c098e?d=identicon)[sharapeco](/maintainers/sharapeco)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
