Welcome Guest, Not a member yet? Register   Sign In
Hi All
#1

[eluser]ppwalks[/eluser]
Has anyone had any experience with redactor wisywig because i'm finding it really difficult to get it to upload, the basis of my upload function is as follows

Code:
public function image_upload()
        {
    if(!empty($_FILES['userfile']['name'])) {
   $config['upload_path'] = '/uploads/images';
            $config['allowed_types'] = 'gif|jpg|png';
   $this->load->library('upload', $config);
      
            if($this->upload->do_upload('userfile')) {
               $image_data = $this->upload->data();
    $json = array('filelink' => "/uploads/images/{$image_data['file_name']}");
    echo stripslashes(json_encode($json));
                     }
                }
        }

It connects to it fine but firebug is constantly throwing back an error regarding the json I think, i have very little knowledge in javascript and json so if some kind soul would point me in the right direction i would reaaly appreciate it. Here's my firebug console error

Code:
TypeError: rawString.match(...) is null

var jsonString = rawString.match(/\{(.|\n)*\}/)[0];

god knows how to fix it and there is no good docs on redactor website

Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB