PHPackages                             ferguson/yii2-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. ferguson/yii2-upload

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

ferguson/yii2-upload
====================

upload a file from local to remote server, a widget based on yii2.

01JavaScript

Since Apr 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ferguson95/yii2-upload)[ Packagist](https://packagist.org/packages/ferguson/yii2-upload)[ RSS](/packages/ferguson-yii2-upload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2-upload
===========

[](#yii2-upload)

This is a uploaded library with [plupload](https://github.com/moxiecode/plupload) used to upload file.

> NOTE: This extension depends on the [yiisoft/yii2](https://github.com/yiisoft/yii2) extension. Check the [composer.json](http://git.mlfh.info/ferguson/yii2-upload/src/master/composer.json) for this extension's requirements and dependencies. PHP environment require `fileinfo`, if upload files is a image `imagick` or `gd` required. `imagick` is recommend and be priority of use

Why this extension
------------------

[](#why-this-extension)

To ensure upload large files on most browsers, but in addition to [plupload](https://github.com/moxiecode/plupload), all other plug-ins in use there is a little problem, such as [uploadify](http://www.uploadify.com/)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Either run

```
$ php composer.phar require ferguson/yii2-upload "dev-master"

```

or add

```
"ferguson/yii2-upload": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your application configuration as follows:

```
return [
    'modules' => [
        'upload' => [
            'class' => \ferguson\upload\Module::className(),
            'storage' => 'file', // which storage used, default `file` means file will be upload on server. other storages could be supported soon.
            'params' => [
                'dir' => '@webroot', // file upload directory, default `@webroot`, you can customer.
                'url' => '@web', // file uploaded host, default `@web`, you can customer.
                'resize' => [
                    'width' => '90',
                    'height' => '120',
                ], // thumb images size.
                'watermark' => [
                    'type' => ['font', 'image'], //null|string|array, which water type, single or both or none.
                    'position' => '',
                    //font water setting.
                    'font' => [
                        'ttf' => '',
                        'text' => '',//string, water text.
                        'size' => '10',// font size, default 10px
                    ],
                    //image water setting.
                    'image' => [
                        'src' => '', //string, water image path, absolute path.
                        'size' => ''
                    ],
                ],
            ],
        ],
        //...
    ],
    //...
];
```

use in view pages.

```
use ferguson\upload\Upload;

//Normal with ActiveForm & model
echo $form->field($model, 'logo')->widget(Upload::className(), [
    'clientOptions' => [
        'type' => Upload::TYPE_IMAGE,
        'max_size' => '2mb',
    ]
]);
```

License
-------

[](#license)

**yii2-upload** is released under the MIT License. See the bundled `LICENSE.md` for details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c31316b4eca673cb70034392654f558478fa506d642d6f29d073534118d44a7?d=identicon)[dareks](/maintainers/dareks)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/ferguson-yii2-upload/health.svg)

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

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