PHPackages                             vadymsemeniuk/yii2-file-processor-module - 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. vadymsemeniuk/yii2-file-processor-module

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

vadymsemeniuk/yii2-file-processor-module
========================================

Extension to upload and store files

1.0.3(1y ago)387.5k—4%9MITPHP

Since Feb 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vadimsemenykv/yii2-file-processor-module)[ Packagist](https://packagist.org/packages/vadymsemeniuk/yii2-file-processor-module)[ RSS](/packages/vadymsemeniuk-yii2-file-processor-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (10)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/939e1b1b273bc94a1e067f3ad4ff1f52b7b75a2b5590a219aab0621f381408fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766164796d73656d656e69756b2f796969322d66696c652d70726f636573736f722d6d6f64756c65)](https://packagist.org/packages/vadymsemeniuk/yii2-file-processor-module)[![Latest Stable Version](https://camo.githubusercontent.com/63f741f59ebc7626b8bf8aa3a875200f95d0f5b98e45bee0d926f5420b9187ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766164796d73656d656e69756b2f796969322d66696c652d70726f636573736f722d6d6f64756c65)](https://packagist.org/packages/vadymsemeniuk/yii2-file-processor-module)

Yii2 file processor module
==========================

[](#yii2-file-processor-module)

Extension to upload and store files

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist vadymsemeniuk/yii2-file-processor-module "*"

```

or add

```
"vadymsemeniuk/yii2-file-processor-module": "*"

```

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

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
./yii migrate --migrationPath=@vendor/metalguardian/yii2-file-processor-module/src/migrations
```

UploadBehavior
--------------

[](#uploadbehavior)

add this to behaviors of model

```
'upload_image_id' => [
                'class' => \metalguardian\fileProcessor\behaviors\UploadBehavior::className(),
                'attribute' => 'image_id',
                'required' => false,
                'image' => true,

```

DeleteBehavior
--------------

[](#deletebehavior)

add this to behaviors of model

for one attribute

```
'delete_image_id' => [
                'class' => \backend\components\DeleteBehavior::className(),
                'attribute' => 'image_id',
            ],

```

for array of attributes

```
'delete_media_files' => [
                'class' => \backend\components\DeleteBehavior::className(),
                'attribute' => ['image_id', 'video_id'],
            ],

```

UploadDeleteBehavior
--------------------

[](#uploaddeletebehavior)

add this to behaviors of model

```
'upload_delete_image_id' => [
                'class' => \metalguardian\fileProcessor\behaviors\UploadDeleteBehavior::className(),
                'attribute' => 'image_id',
                'required' => false,
                'image' => true,

```

PNG Compression
---------------

[](#png-compression)

To switch-on compression for png-images install . Then add to console controller action `ImageCompressor::compressPngThumbs($path);`, where $path is path to thumbnails folder and setup cron task from user which creates files, for example www-data(crontab -u www-data -e).

Adding watermarks to thumbnails
-------------------------------

[](#adding-watermarks-to-thumbnails)

To add watermark while creating FPM::ACTION\_ADAPTIVE\_THUMBNAIL, FPM::ACTION\_THUMBNAIL or FPM::ACTION\_CANVAS\_THUMBNAIL config must be like this:

```
'sliderThumb' => [
                        'action' => FPM::ACTION_THUMBNAIL,
                        'width' => 330,
                        'height' => 330,
                        'watermark' => [
                            'fileName' => $wmarkPath,
                            'point' => [
                                'x' => 0,
                                'y' => 0,
                            ],
                            'size' => [
                                'width' => 330,
                                'height' => 330,
                            ]
                        ],
                    ],

```

where 'point' (coordinates of point on originap image where to place watermark) and 'size' (size of watermark's thumbnail if it larger then original image) are optional, only 'fileName' is required. If watermark size is larger then original image - it will not be pasted into original image. To fix this - module will create thumbnail of watermark with original image size to fit it.

Change quality of images
------------------------

[](#change-quality-of-images)

To change quality of thumbnail you need to specify `quality` property in config:

```
'thumbImage' => [
    'action' => FPM::ACTION_THUMBNAIL,
    'width' => 330,
    'height' => 330,
    'quality' => 75,
],
```

This property must be an integer in range from 0 to 100.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~769 days

Total

6

Last Release

546d ago

Major Versions

0.0.2 → 1.0.02016-06-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d050fe29a9bdad7efe48b89e5bccdb1252958d86382021dc4b6f2e2a88e3603?d=identicon)[Vadym Semeniuk](/maintainers/Vadym%20Semeniuk)

---

Top Contributors

[![vadimsemenykv](https://avatars.githubusercontent.com/u/8122660?v=4)](https://github.com/vadimsemenykv "vadimsemenykv (27 commits)")[![MetalGuardian](https://avatars.githubusercontent.com/u/1168520?v=4)](https://github.com/MetalGuardian "MetalGuardian (26 commits)")[![hanterrian](https://avatars.githubusercontent.com/u/3724093?v=4)](https://github.com/hanterrian "hanterrian (2 commits)")[![a-bilyi](https://avatars.githubusercontent.com/u/8568800?v=4)](https://github.com/a-bilyi "a-bilyi (2 commits)")[![athl64](https://avatars.githubusercontent.com/u/4989972?v=4)](https://github.com/athl64 "athl64 (2 commits)")[![tolik505](https://avatars.githubusercontent.com/u/12429244?v=4)](https://github.com/tolik505 "tolik505 (2 commits)")[![bTokman](https://avatars.githubusercontent.com/u/23096113?v=4)](https://github.com/bTokman "bTokman (1 commits)")[![insane-dev](https://avatars.githubusercontent.com/u/3304603?v=4)](https://github.com/insane-dev "insane-dev (1 commits)")

---

Tags

fileuploadyii2extension

### Embed Badge

![Health badge](/badges/vadymsemeniuk-yii2-file-processor-module/health.svg)

```
[![Health](https://phpackages.com/badges/vadymsemeniuk-yii2-file-processor-module/health.svg)](https://phpackages.com/packages/vadymsemeniuk-yii2-file-processor-module)
```

###  Alternatives

[mohorev/yii2-upload-behavior

Upload behavior for Yii 2

128265.5k9](/packages/mohorev-yii2-upload-behavior)[nemmo/yii2-attachments

Extension for file uploading and attaching to the models

6616.6k5](/packages/nemmo-yii2-attachments)[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)
