PHPackages                             razonyang/yii2-uploader - 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. razonyang/yii2-uploader

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

razonyang/yii2-uploader
=======================

Yii2 Uploader

1.0.1(6y ago)64.0k[1 issues](https://github.com/razonyang/yii2-uploader/issues)1BSD-3-ClausePHPPHP ^7.1

Since Aug 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/razonyang/yii2-uploader)[ Packagist](https://packagist.org/packages/razonyang/yii2-uploader)[ RSS](/packages/razonyang-yii2-uploader/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (1)

Yii2 Uploader
=============

[](#yii2-uploader)

[![Build Status](https://camo.githubusercontent.com/58189c97650ff1a11855bcb932fefe30c04607e2f020e778f352c581d305e967/68747470733a2f2f7472617669732d63692e6f72672f72617a6f6e79616e672f796969322d75706c6f616465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/razonyang/yii2-uploader)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ef80c19a90d3f56f2e0c9b1664ac75a0bb396b0d648ca06e6fb6868d985dd954/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72617a6f6e79616e672f796969322d75706c6f616465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/razonyang/yii2-uploader/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/44c6388d77a1bba0c19d4b363b422cd703d879b8f742c26c17ffc611eb4ce2ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72617a6f6e79616e672f796969322d75706c6f616465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/razonyang/yii2-uploader/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/62a88271764fffae2f32aecd216a18486e6dde51eacaefba852dc3b761509c96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72617a6f6e79616e672f796969322d75706c6f616465722e737667)](https://packagist.org/packages/razonyang/yii2-uploader)[![Total Downloads](https://camo.githubusercontent.com/785bedf00fa7884ad9febd355d2f56bf2df07f7a259aa49fcc8519a43fd73780/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72617a6f6e79616e672f796969322d75706c6f616465722e737667)](https://packagist.org/packages/razonyang/yii2-uploader)[![LICENSE](https://camo.githubusercontent.com/0c0a616482a562dd5fef3f3437197d15d182937eb84e38f56c4811e355618599/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f72617a6f6e79616e672f796969322d75706c6f61646572)](LICENSE)

Supports multiple filesystems:

- [Yii2 Flysystem](https://github.com/creocoder/yii2-flysystem) - Local, FTP, AWS S3, Azure filesystem etc.
- [Aliyun OSS Flysystem](https://github.com/razonyang/yii2-flysystem-aliyun-oss)

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

[](#installation)

```
composer require razonyang/yii2-uploader

```

Usage
-----

[](#usage)

Configuration:

```
return [
    'components' => [
        'filesystem' => [
            'class' => \creocoder\flysystem\LocalFilesystem::class,
            'path' => '@webroot/resources',
        ],
        'uploader' => [
            'class' => \RazonYang\Yii2\Uploader\Uploader::class,
            'host' => 'http://localhost/resources', // the hostname relative to your uploaded files
            'filesystem' => 'filesystem',
        ],
    ],
];
```

And then defines a form, `UploadForm`

```
class UploadForm extends \yii\base\Model
{
    use \RazonYang\Yii2\Uploader\UploadModelTrait;

    public function handle()
    {
        if (!$this->validate()) {
            // handles error
            throw new \Exception('invalid file');
        }

        $url = $this->upload();
        return [
            'url' => $url,
            // ... other information
        ];
    }
}

class UploadController extends \yii\web\Controller
{
    public function actionUpload()
    {
        $form = new UploadForm([
            'file' => \yii\web\UploadedFile::getInstanceByName('file')
        ]);
        return $form->handle();
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

2448d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17720932?v=4)[Razon Yang](/maintainers/RazonYang)[@razonyang](https://github.com/razonyang)

---

Top Contributors

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

---

Tags

yii2extensionfile-uploaduploader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/razonyang-yii2-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/razonyang-yii2-uploader/health.svg)](https://phpackages.com/packages/razonyang-yii2-uploader)
```

###  Alternatives

[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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