PHPackages                             hryvinskyi/magento2-media-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. hryvinskyi/magento2-media-uploader

ActiveMagento2-module[File &amp; Storage](/categories/file-storage)

hryvinskyi/magento2-media-uploader
==================================

Media uploader module for Magento 2

1.0.0(4mo ago)083↓33.3%1proprietaryPHPPHP ^8.1

Since Jan 31Pushed 4mo agoCompare

[ Source](https://github.com/hryvinskyi/magento2-media-uploader)[ Packagist](https://packagist.org/packages/hryvinskyi/magento2-media-uploader)[ RSS](/packages/hryvinskyi-magento2-media-uploader/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

Hryvinskyi MediaUploader
========================

[](#hryvinskyi-mediauploader)

A Magento 2 module for handling media file uploads with support for temporary storage and permanent file management.

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer require hryvinskyi/module-media-uploader
```

### Manual Installation

[](#manual-installation)

1. Create directory `app/code/Hryvinskyi/MediaUploader`
2. Copy module files to this directory
3. Run setup commands:

```
bin/magento module:enable Hryvinskyi_MediaUploader
bin/magento setup:upgrade
bin/magento setup:di:compile
```

Configuration via DI Virtual Types
----------------------------------

[](#configuration-via-di-virtual-types)

Configure file upload settings using virtual types in your module's `di.xml`:

```

        your_module/tmp/image
        your_module/image

            jpg
            jpeg
            png
            gif
            webp

            image/jpg
            image/jpeg
            image/png
            image/gif
            image/webp

```

Usage Examples
--------------

[](#usage-examples)

### Upload Command

[](#upload-command)

```
use Hryvinskyi\MediaUploader\Api\Command\UploadInterface;

class YourController
{
    public function __construct(
        private readonly UploadInterface $uploadCommand
    ) {}

    public function execute(): array
    {
        // Upload file from $_FILES['image']
        return $this->uploadCommand->execute('image');
    }
}
```

### Move File from Temporary Storage

[](#move-file-from-temporary-storage)

```
use Hryvinskyi\MediaUploader\Api\Command\MoveFileFromTmpInterface;

class YourSaveController
{
    public function __construct(
        private readonly MoveFileFromTmpInterface $moveFileFromTmp
    ) {}

    public function execute(array $imageData): string
    {
        // Move file from tmp to permanent storage
        return $this->moveFileFromTmp->execute($imageData);
    }
}
```

### Using FileUploader Directly

[](#using-fileuploader-directly)

```
use Hryvinskyi\MediaUploader\Api\FileUploaderInterface;

class YourService
{
    public function __construct(
        private readonly FileUploaderInterface $fileUploader
    ) {}

    public function uploadAndMove(string $fileId): string
    {
        // Save to temporary directory
        $result = $this->fileUploader->saveFileToTmpDir($fileId);

        // Move to permanent storage
        return $this->fileUploader->moveFileFromTmp($result['name']);
    }
}
```

API Reference
-------------

[](#api-reference)

### FileUploaderInterface

[](#fileuploaderinterface)

MethodDescription`getBaseTmpPath(): string`Get base temporary path for uploads`getBasePath(): string`Get base path for permanent storage`getAllowedExtensions(): array`Get list of allowed file extensions`getFilePath(string $path, string $imageName): string`Build full file path`moveFileFromTmp(string $imageName): string`Move file from tmp to permanent storage`saveFileToTmpDir(string $fileId): array`Save uploaded file to temporary directory### UploadInterface

[](#uploadinterface)

MethodDescription`execute(string $imageId = 'image'): array`Execute file upload to temporary directory### MoveFileFromTmpInterface

[](#movefilefromtmpinterface)

MethodDescription`execute(array $image): string`Move file from tmp and return relative pathData Providers
--------------

[](#data-providers)

### PrepareImageToArray

[](#prepareimagetoarray)

Converts image path string to array format for UI components (used when loading data).

### PrepareImageToString

[](#prepareimagetostring)

Converts image array format to string path and moves file from tmp directory (used when saving data).

Requirements
------------

[](#requirements)

- PHP 8.1+
- Magento 2.4.x
- Magento\_MediaStorage
- Magento\_Store

License
-------

[](#license)

Proprietary

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance74

Regular maintenance activity

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

147d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9294098?v=4)[Volodymyr Hryvinskyi](/maintainers/hryvinskyi)[@hryvinskyi](https://github.com/hryvinskyi)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hryvinskyi-magento2-media-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/hryvinskyi-magento2-media-uploader/health.svg)](https://phpackages.com/packages/hryvinskyi-magento2-media-uploader)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.3M1](/packages/fastly-magento2)[amzn/amazon-pay-magento-2-module

Official Magento2 Plugin to integrate with Amazon Pay

108521.2k1](/packages/amzn-amazon-pay-magento-2-module)[baldwin/magento2-module-image-cleanup

Magento 2 module which can cleanup old image files that are no longer being used

82103.9k](/packages/baldwin-magento2-module-image-cleanup)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[shipperhq/module-shipper

Magento Shipping integration with ShipperHQ

201.0M2](/packages/shipperhq-module-shipper)[buckaroo/magento2

Buckaroo Magento 2 extension

32414.8k7](/packages/buckaroo-magento2)

PHPackages © 2026

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