gustarus/yii2-upload

A module to upload and download files through an api and an interface to manage uploads

Installs: 144

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.1.0 2019-10-02 16:30 UTC

This package is auto-updated.

Last update: 2024-03-29 04:11:24 UTC


README

This package is a module to manage uploads. This module has two actions DownloadAction and UploadAction to use them inside your controllers. Also this module has web interface to show your upload and to manage them.

Installation

1. Require the package via composer

composer require gustarus/yii2-upload

2. Add some code to your default configuration file

This file should be used inside both web and console. Also you should define uploads folder (where to store uploaded files).

[
  'aliases' => [
    '@uploads' => '@app/web/uploads',
  ],
  
  'modules' => [
    'upload' => [
      'class' => 'gustarus\upload\Module',
    ],
  ],
];

3. Add some code to your console configuration file

With this code you will enable migrations from this package.

[
  'controllerNamespace' => 'app\commands',
  'controllerMap' => [
    'migrate' => [
      'class' => 'yii\console\controllers\MigrateController',
      'migrationPath' => [
        '@gustarus/upload/migrations',
      ],
    ],
  ],
]

4. Use this module

The module interface will be available by /upload uri.

To be done

  • Describe how to use the actions inside controllers.
  • Describe how to send data to the upload action.
  • Describe how to use the download action.