PHP code example of dungang / yii2-fex-webuploader

1. Go to this page and download the library: Download dungang/yii2-fex-webuploader 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/ */

    

dungang / yii2-fex-webuploader example snippets


'webuploader'=>[
    'class'=>'dungang\webuploader\Module',
//下面是默认配置    
//    [
        /**
         * @var array 访问角色 默认是登录用户才可以
         */
//        role => ['@'],
         
        /**
         * @var string 上传文件的驱动
         */
//        'driver' => 'dungang\storage\driver\Local',
//        'driver' => [
                'class'=>'dungang\storage\driver\AliYunOSS',
                //Yii::$app->params['oss']
                'paramKey'=>'oss'
            ],
    
        /**
         * @var string 上传文件保存的相对路径
         */
//        'saveDir' => '/upload/webuploader',
    
        /**
         * @var array 接受的文件类型
         */
//        'accept' => ['gif','jpg','png','bmp','docx','doc','ppt','xsl','rar','zip','7z']
//    ]
],
    

'webuploader'=>[
    'class'=>'dungang\webuploader\Module',
    [
        'driver' => [
                'class'=>'dungang\webuploader\components\AliYunOSSUploader',
                //Yii::$app->params['oss']
                'paramKey'=>'oss',
                //参考Yii2行为配置
                'as aliyunBehavior'=>'behiaviorClassName'
            ],
    ]
],