0
votes

My site is a Codeigniter with kcfinder and ckeditor, and my issue is when I try upload and load an image, this image upload correctly in an autocreated folder /assets/kcfinder/.thumbs/images/, but When I select the image from server, the URL is wrong and I can not see it. How can I set the correct path?

Screenshot

3
how do you pick the image from server? I suggest you edit your question! - Vickel
Hi Vickel, I select the image from server clicking in button "Show server". Image is there but I select it, it does not load correctly. Image not show, I think is a path problem. - Nando

3 Answers

0
votes

I thing that the problem is that you need to add the base url in your image path

base_url() . 'images/' . $img;

0
votes

I have solved the problem. In ../assets/kcfinder/config.php I changed:

'uploadURL' from "upload" to Absolute url and in 'uploadDir' from "" to "upload" and it worked!

Thanks anyway.

0
votes

You can also use below code to set your KcFinder config settings:

<?php
/**
 * KcFinder has a SESSION key name 'KCFINDER'
 * You can use this as setup your dynamic config vales
 * if you set uploadURL and uploadDir via SESSION, KcFinder ignore config.php
 * to get these values and it start using SESSION values
 */
$_SESSION['KCFINDER'] = array(
    'disabled'  => false,
    'uploadURL' => 'http://www.example.com/upload',
    'uploadDir' => 'var/htdocs/www/upload'
);

More: See Link