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

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

r-gonchar/yii2-file-processor-module
====================================

Extension to upload and store files

1.0.3(2y ago)01MITPHP

Since Feb 23Pushed 2y agoCompare

[ Source](https://github.com/kozerog91/yii2-file-processor-module)[ Packagist](https://packagist.org/packages/r-gonchar/yii2-file-processor-module)[ RSS](/packages/r-gonchar-yii2-file-processor-module/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/a83a57916375be9357896489a32edf3013b0bbf1c007407271e5641d423d926a/68747470733a2f2f706f7365722e707567782e6f72672f766164796d73656d656e69756b2f796969322d66696c652d70726f636573736f722d6d6f64756c652f642f746f74616c2e706e67)](https://packagist.org/packages/vadymsemeniuk/yii2-file-processor-module)[![Latest Stable Version](https://camo.githubusercontent.com/a4ef8262a2ca9e0eddef9cf27abc47cdeef0c1f10cb9674ec7306e824d806396/68747470733a2f2f706f7365722e707567782e6f72672f766164796d73656d656e69756b2f796969322d66696c652d70726f636573736f722d6d6f64756c652f762f737461626c652e706e67)](https://packagist.org/packages/vadymsemeniuk/yii2-file-processor-module)[![Dependency Status](https://camo.githubusercontent.com/7fbd0301348d8040770fa9d3a24633a675a8103b7f2c8a5a67f220e86617b973/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f766164796d73656d656e69756b3a796969322d66696c652d70726f636573736f722d6d6f64756c652f6465762d6d61737465722f62616467653f7374796c653d666c6174)](https://www.versioneye.com/php/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.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

861d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/875caa297ee991880765ddd88e3009d1ee44ad48aa81f5a2e37edda83119d6b2?d=identicon)[roman\_gonchar](/maintainers/roman_gonchar)

---

Top Contributors

[![MetalGuardian](https://avatars.githubusercontent.com/u/1168520?v=4)](https://github.com/MetalGuardian "MetalGuardian (26 commits)")[![vadimsemenykv](https://avatars.githubusercontent.com/u/8122660?v=4)](https://github.com/vadimsemenykv "vadimsemenykv (24 commits)")[![hanterrian](https://avatars.githubusercontent.com/u/3724093?v=4)](https://github.com/hanterrian "hanterrian (2 commits)")[![kozerog91](https://avatars.githubusercontent.com/u/9293253?v=4)](https://github.com/kozerog91 "kozerog91 (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/r-gonchar-yii2-file-processor-module/health.svg)

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

###  Alternatives

[vadymsemeniuk/yii2-file-processor-module

Extension to upload and store files

12299.9k](/packages/vadymsemeniuk-yii2-file-processor-module)[mohorev/yii2-upload-behavior

Upload behavior for Yii 2

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

Extension for file uploading and attaching to the models

6416.7k5](/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)
