T
T
The Dragger2015-04-03 09:42:38
Yii
The Dragger, 2015-04-03 09:42:38

Problem with paths in yii?

<?php
        $this->widget('ImperaviRedactorWidget', array(
            // You can either use it for model attribute
            'model' => $model,
            'attribute' => 'img_url',
            // or just for input field
            'name' => 'my_input_name',
            // Some options, see http://imperavi.com/redactor/docs/
            'options' => array(
                'lang' => 'ru',
                'toolbar' => true,
                'iframe' => true,
                'css' => 'wym.css',
                'imageUpload' => '/MyGallery/upload',     
            ),
        ));
        ?>

The point is ImageUpload - when I write the path to the controller and the method there, the picture is uploaded, and when I write it through the 'imageUpload' => '/admin/MyGallery/upload' module,
then this is the error in the
POST console yiiroot.yii/admin/ MyGallery/upload 403 (Forbidden)redactor.js:7729 Redactor.fn.$.Editor.upload.sendDataredactor.js:7630 Redactor.fn.$.Redactor.upload.traverseFileredactor.js:7586 (anonymous function)jquery.js: 547 jQuery.extend.proxy.proxyjquery.js:4641 jQuery.event.dispatchjquery.js:4309 jQuery.event.add.elemData.handle

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilyas Galiev, 2015-04-03
@IPD2

The error clearly says - 403.
Most likely, this path is closed in the Apache or nginx settings.
Well, or maybe closed everything in the filters.

E
eldar_web, 2015-04-03
@eldar_web

You are in the admin panel and still point to '/admin' ?
That first working option will be more correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question