R
R
Ruslan Tilyaev2019-07-20 13:38:23
Yii
Ruslan Tilyaev, 2019-07-20 13:38:23

Why do I get a 404 error when trying to upload an image using the elfinder plugin?

Installed ckeditor and elfinder plugins on yii2 advanced. I get a 404 error when I try to upload an image.
main.php

'controllerMap' => [
            'class' => 'mihaildev\elfinder\PathController',
            'elfinder' => [
                'access' => ['@'],
                'root' => [
                    'baseUrl'=>'/web',
//                'basePath'=>'@webroot',
                    'path' => 'upload/global',
                    'name' => 'Global'
                ],
            ]
        ],

_form.php
<? echo $form->field($model, 'description')->widget(CKEditor::className(), [
        'editorOptions' => ElFinder::ckeditorOptions('elfinder', []),
    ]); ?>

5d32efc83f550148005591.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-07-20
@Heckfy325

You made the wrong settings) It's obvious. Controller class placed above action in controllerMap

'controllerMap' => [
            'elfinder' => [
            'class' => 'mihaildev\elfinder\PathController', /////ВОТ ЗДЕСЬ ДОЛЖНО БЫТЬ!
                'access' => ['@'],
                'root' => [
                    'baseUrl'=>'/web',
//                'basePath'=>'@webroot',
                    'path' => 'upload/global',
                    'name' => 'Global'
                ],
            ]
        ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question