1. Go to this page and download the library: Download fredyns/yii2-attachments 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/ */
fredyns / yii2-attachments example snippets
'modules' => [
...
'attachments' => [
'class' => fredyns\attachments\Module::class,
'rules' => [ // Rules according to the FileValidator
'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3
'mimeTypes' => 'image/png', // Only png images
'maxSize' => 1024 * 1024 // 1 MB
],
'tableName' => '{{%attachments}}' // Optional, default to 'attach_file'
'filesystem' => 'awss3Fs' // you can change though
]
...
]