Yii-Redactor Or Imperaviredactorwidget?

Hi there,

I’m trying to get redactor to work with image upload but I don’t know if I need to use Yii-redactor or not.

I’ve got redactor working (without image upload) using ImperaviRedactorWidget but I can’t get Yii-redactor to do anything at all.

Do I need yii-redactor to implement image upload functionality or can I do it with ImperaviRedactorWidget?

Any advice would be greatly appreciated.

Thanks in advance.

OK, does anyone have any tips about getting the image upload to work?

Here is what I have so far:

I have downloaded ImperaviRedactorWidge and extracted into the extensions folder.

I have done the same for RedactorUploadAction

In the view:


Yii::import('ext.imperavi-redactor-widget.ImperaviRedactorWidget');

				$this->widget('ImperaviRedactorWidget',array(

					// you can either use it for model attribute

					'model'=>$model,

					'attribute'=>'description',

					// or just for input field

					//'name'=>'my_input_name',

					// imperavi redactor [options](http://imperavi.ru/redactor/docs/)

					'options'=>array(

						'toolbar'=>'classic',

						'cssPath'=>Yii::app()->theme->baseUrl.'/css/',

						'imageUpload'=>$this->createUrl('property/imgUpload'),

        				'imageUploadErrorCallback'=>'js:function(obj, json){ alert(json.error); }', // function to show upload error to user

					),

				));

In the controller I have created the action() function:


public function actions()

    {

                return array(

                        'imgUpload'=>array(

							'class' => 'ext.redactor-upload-action.RedactorUploadAction',

							'directory'=>'/uploads/images/',

							'validator'=>array(

								'mimeTypes' => array('image/png', 'image/jpg', 'image/gif', 'image/jpeg', 'image/pjpeg'),

							)

						),

                );

    }

The redactor editor renders fine in the view but when I try to upload an image the Insert Image box appears, I click choose file to browse to my computer but when I select a file nothing appears in the Insert Image box. The Console says:

There is a thread here from last year with the same issue but no solution.

Any ideas?