Kcfinder Upload image issue

二次信任 提交于 2019-12-12 03:36:43

问题


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?


回答1:


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

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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/36271925/kcfinder-upload-image-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!