1. Go to this page and download the library: Download pozitronik/yii2-filestorage library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pozitronik / yii2-filestorage example snippets
'filestorage' => [
'class' => FSModule::class,
'defaultRoute' => 'index',
'params' => [
'tableName' => 'sys_file_storage',//используемая таблица хранения метаданных
'tableNameTags' => 'sys_file_storage_tags',//используемая таблица хранения тегов
'base_dir' => '@app/web/uploads/',//каталог хранения файлов
'models_subdirs' => true,//файлы каждой модели кладутся в подкаталог с именем модели
'name_subdirs_length' => 2//если больше 0, то файлы загружаются в подкаталоги по именам файлов (параметр регулирует длину имени подкаталогов)
]
]