Yii Framework Forum: Uploading Images With Redactorjs, Inserting Into Editor Fails - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Uploading Images With Redactorjs, Inserting Into Editor Fails Rate Topic: -----

#1 User is offline   Stefano Mtangoo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 298
  • Joined: 02-January 12
  • Location:Dar es Salaam, Tanzania

Posted 14 May 2013 - 04:24 AM

I use extension located here and It displays editor. I then use this extension to upload images and it does upload. The problem is, after uploading the dialog vanishes. When I reopen it there is no option to browse files I uploaded and insert them in editor.

I believe I'm missing something here because If I try YiiBooster's RedactorJs it presents those options but then I cannot make it upload files. Moreover, in YB's there is third method dealing with thumbnails but this extension seems to posses none (or I missed docs somewhere). I have no idea what to do next and I need help!

-regards,
Stefano
And God said, Let there be science...and it was so! Forum coded in Yii2 here!
0

#2 User is offline   wadim 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 19-March 13

Posted 12 June 2013 - 05:54 AM

maybe this'll help:

This is the widget
$this->widget('ImperaviRedactorWidget',
            array(
                'model' => $model,
                'attribute' => 'content',
                'options' => array(
                    'lang'      => 'en',
                    'minHeight' => 200,
                    'toolbar'   => true,
                    'iframe'    => true,
                    'autoresize'    => true,
                    'imageUpload'   =>'/index.php?r=file/imgUpload',
                    'imageUploadErrorCallback'=>'js:function(obj, json){ alert(json.error); }',
                ),
            )
        );


and this is from my "FileController"
public function actions()
	{
		return array(
			'imgUpload'=>array(
			    'class' => 'ext.imperavi-redactor-widget.actions.imgUpload.RedactorUploadAction',
			    'directory'=>'uploads/files',
			    'validator'=>array(
			        'mimeTypes' => array('image/png', 'image/jpg', 'image/gif', 'image/jpeg', 'image/pjpeg'),
			    )
			),
		);
	}

PS. you have to create the "uploads/files" folder under your root

if this won't help try to look in the browser console (in chrome Ctrl+Shift+J), maybe you'll get some more info about the error
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users