PHPackages                             maymeow/file-upload - 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. maymeow/file-upload

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

maymeow/file-upload
===================

FileUpload plugin for CakePHP

v2.0.0(2y ago)01.5k[1 PRs](https://github.com/MayMeow/cakephp-fileupload/pulls)MITPHPPHP &gt;=7.2CI failing

Since Sep 11Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/MayMeow/cakephp-fileupload)[ Packagist](https://packagist.org/packages/maymeow/file-upload)[ GitHub Sponsors](https://github.com/maymeow)[ Fund](https://ko-fi.com/maymeow)[ RSS](/packages/maymeow-file-upload/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (5)Dependencies (4)Versions (17)Used By (0)

🆙 FileUpload plugin for CakePHP
===============================

[](#-fileupload-plugin-for-cakephp)

Note

This is readme for version 2.x. For 1.x go to [v1.1.2](https://github.com/MayMeow/cakephp-fileupload/tree/v1.1.2) release.

Caution

🛑 Breaking changes (read before use)

Version 2.x is not compatibile with cakephp lower than 5.x and it is not backward compatibile with previous releases of this plugins.

- S3 storage support was removed (will be added in future relases)
- Bunny CND storage support was added
- All components and Managers was rewritten.

And supported actions are upload and download.

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

🐘 From packagist
----------------

[](#-from-packagist)

```
composer require maymeow/file-upload "^2.0.0"

```

Usage
-----

[](#usage)

Add configuration somewhere to your config files

```
'Storage' => [
    'defaultStorageType' => env('STORAGE_DEFAULT_STORAGE_TYPE', 'local'),
    'local' => [
        'managerClass' => LocalStorageManager::class,
        'storagePath' => env('STORAGE_LOCAL_STORAGE_PATH', ROOT . DS . 'storage' . DS),
    ],
    'bunny' => [
        'managerClass' => BunnyStorageManager::class,
        'cdnDomain' => env('BUNNY_STORAGE_CDN_DOMAIN', ''), // your cnd url
        'region' => env('BUNNY_STORAGE_REGION', ''), // region, empty is DE
        'baseHostName' => 'storage.bunnycdn.com', // base host name not changeable
        'storageZone' => env('BUNNY_STORAGE_ZONE', ''), // your storage zone name
        'storageZonePath' => env('BUNNY_STORAGE_ZONE_PATH', ''), // folder in zono
        'accessKey' => env('BUNNY_STORAGE_ACCESS_KEY', ''), // API key for write access
    ]
]
```

For bunny cdn minimal configuration is to have folowing keys configured

```
BUNNY_STORAGE_ACCESS_KEY=
BUNNY_STORAGE_CDN_DOMAIN=
BUNNY_STORAGE_ZONE=
```

If you need/want nginx to server your static files without PHP set `STORAGE_LOCAL_STORAGE_PATH` location to whe webroot folder.

Load plugin with adding

```
$this->addPlugin('FileUpload'); // in your Application.php bootstrap function
```

or you can add your plugin with `plugins.php` config file

```
return [
    // .. your other plugins
    'FileUpload' => [],
];
```

Loading components

```
$config = Configure::read('Storage.local'); // or Storage.bunny

// or by setting it with .env STORAGE_DEFAULT_STORAGE_TYPE
$storageType = Configure::read('Storage.defaultStorageType');
$config = Configure::read('Storage.' . $storageType);

$this->loadComponent('FileUpload.Upload', $config);
$this->loadComponent('FileUpload.Download', $config);
```

Uploading files

```
$file = $this->Upload->getFile($this);
// do something with file

// store your file name in database
$file->getFileName(); // sanitized file name - with removed restricted characters in the name
```

```
$file = $this->Download->getFile($resource->name);
// do something with file
```

📝 Note that the function above will read content of file and you then need to use response to push it to the viewer. If you want to do it without using PHP you will need to get URL of file and if you using local storage manager your folder need to be in webrootfolder.

```
$file->get('storagePath'); // local: /patht/to/sorage or bunny: https://cdn.your.tld/path/to/folder/
// combine it with filename from your database go download it
```

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance44

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Recently: every ~217 days

Total

7

Last Release

909d ago

Major Versions

v1.1.2 → v2.0.02023-12-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7c2bca298b9947b96e7d8ecc3e58d2a63caf97adb52d28c07dc8b9468cdabb6?d=identicon)[maymeow](/maintainers/maymeow)

---

Top Contributors

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

---

Tags

cakephp-plugincakephp4file-uploadhacktoberfest

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maymeow-file-upload/health.svg)

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

###  Alternatives

[cakephp/bake

Bake plugin for CakePHP

11211.7M190](/packages/cakephp-bake)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

333972.2k49](/packages/dereuromark-cakephp-tools)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308914.0k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M40](/packages/dereuromark-cakephp-ide-helper)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131237.3k13](/packages/dereuromark-cakephp-tinyauth)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

35184.7k2](/packages/dereuromark-cakephp-setup)

PHPackages © 2026

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