PHPackages                             qianlizeguo/yii2-mall-storage - 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. qianlizeguo/yii2-mall-storage

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

qianlizeguo/yii2-mall-storage
=============================

A file uploading extension for Yii2, saving files to object storage service.

115[1 PRs](https://github.com/qianlizeguo/yii2-mall-storage/pulls)PHP

Since Jun 6Pushed 2y agoCompare

[ Source](https://github.com/qianlizeguo/yii2-mall-storage)[ Packagist](https://packagist.org/packages/qianlizeguo/yii2-mall-storage)[ RSS](/packages/qianlizeguo-yii2-mall-storage/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Mall Storage
============

[](#mall-storage)

Usage
-----

[](#usage)

1. Firstly, add this lines of code to your Yii application config:

    ```
    'components' => [
        'class' => 'Hejiang\Storage\Components\StorageComponent',
        'basePath' => 'temp/',
        'driver' => [
            'class' => 'Hejiang\Storage\Drivers\Local',
            'accessKey' => '',
            'secretKey' => '',
            'bucket' => '',
        ]
    ]
    ```
2. Then after app bootstarpping, you would get the storage component instance like that:

    ```
    $storage = \Yii::$app->storage;
    ```

    Alternatively, you can also create a driver while app running:

    ```
    $storage->setDriver('Hejiang\Storage\Drivers\Local', []);
    ```
3. Fetch uploaded file by field name:

    ```
    $file = $storage->getUploadedFile('FILE-FIELD-NAME');
    ```
4. Save it.

    ```
    $url = $file->saveAs('NEW-FILE-NAME.EXT');
    // or
    $url = $file->saveWithOriginalExtension('NEW-FILE-BASE-NAME');
    // or
    $url = $file->saveAsUniqueHash();
    ```

    `$url` will be a URL string which can access this file on success, or `false` on failure.

    If there's any error occurred, these methods will throw a `Hejiang\Storage\Exceptions\StorageException`. Don't forget to `try... catch ...`.

About
-----

[](#about)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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://avatars.githubusercontent.com/u/14157197?v=4)[千里泽国](/maintainers/qianlizeguo)[@qianlizeguo](https://github.com/qianlizeguo)

---

Top Contributors

[![qianlizeguo](https://avatars.githubusercontent.com/u/14157197?v=4)](https://github.com/qianlizeguo "qianlizeguo (1 commits)")

### Embed Badge

![Health badge](/badges/qianlizeguo-yii2-mall-storage/health.svg)

```
[![Health](https://phpackages.com/badges/qianlizeguo-yii2-mall-storage/health.svg)](https://phpackages.com/packages/qianlizeguo-yii2-mall-storage)
```

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