无法让PendalF89/ Yii2 -filemanager在后端工作


Yii2 Cannot get PendalF89/yii2-filemanager to work in backend

我无法让PendalF89/yii2-filemanager在我的后端应用程序中工作。

我正在使用改进的高级模板,可以在这里找到

当我上传图像时,它会转到_protected/backend/uploads,但是我需要这些图像对前端和后端都是公开访问的。

所以上传文件夹需要在受保护的文件夹之外,但是我似乎不能设置我的filemanager配置这样做。

我需要改变基本路径,但我不太确定使用什么别名,因为它似乎总是在当前应用程序根目录下创建一个文件夹,如_protected/后端

这是我当前的配置:

'filemanager' => [
        'class' => 'pendalf89'filemanager'Module',
        // Upload routes
        'routes' => [
            // Base absolute path to web directory
            'baseUrl' => '',
            // Base web directory url
            'basePath' => '@webroot',
            // Path for uploaded files in web directory
            'uploadPath' => 'uploads',
        ],
        // Thumbnails info
        'thumbs' => [
            'small' => [
                'name' => 'Small',
                'size' => [100, 100],
            ],
            'medium' => [
                'name' => 'Medium',
                'size' => [300, 200],
            ],
            'large' => [
                'name' => 'Large',
                'size' => [500, 400],
            ],
        ],
    ],

对我来说,这是工作与这个设置。图像将在eg。"app-root/web/uploads/2015/07/"文件夹(Yii2 basic)。希望这有助于理解。

// Upload routes
    'routes' => [
        // Base absolute path to web directory
        'baseUrl' => '/web',
        // Base web directory url -- htdocs eg.
        'basePath' => dirname(__DIR__),
        // Path for uploaded files in web directory
        'uploadPath' => 'uploads',
    ],