CKEditor and KCfinder image preview on GoDaddy

和自甴很熟 提交于 2019-12-08 20:45:50

问题


I am having a problem with preview of image through KCFinder on CKEditor on GoDaddy hosting.

When I select the image from KCFinder the preview is loaded correctly on my local machine, but when I check on GoDaddy it is not showing correctly. Difference can be seen from below images.

I have configured the file browser in CKEditor as shown in below snippet.

config.filebrowserBrowseUrl = '../admin/kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = '../admin/kcfinder/browse.php?type=media';
config.filebrowserFlashBrowseUrl = '../admin/kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = '../admin/kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = '../admin/kcfinder/upload.php?type=media';
config.filebrowserFlashUploadUrl = '../admin/kcfinder/upload.php?type=flash';

And the KCFinder session is as follows

$_SESSION['KCFINDER']['uploadURL'] = "../upload";
$_SESSION['KCFINDER']['uploadDir'] = "../upload";
$_SESSION['KCFINDER']['disabled'] = false;

Image preview in my localhost.

Image preview on GoDaddy hosting

The main problem I am unable to get the "upload/" directory in URL. You can see the difference in above images.

Can anyone help, how to resolve this problem?

Thanks in advance.


回答1:


I used the absolute path for the uploadURL and it worked!




回答2:


Go to your conf folder inside "kcfinder", then open upload.htaccess file and remove whole text from this (upload.htaccess) file. Finally save it.

And also delete .htaccess file from upload folder inside kcfinder folder.

I hope it's better.




回答3:


you should change '_check4htaccess' => true, line in config.php '_check4htaccess' => false, and delete .htaccess file.




回答4:


I got the same problem, Googling for solution and I found this site. But finally I solve the problem and let me share here.

Just put the x image in the text area. By using menu 'source', check the image url. See what is the problem. If you find something like /plugins/ckeditor/file-manager/yourweb.com/...., it means that you are not put http:// in your upload dir. It should be like this :

'disabled' => false,
'uploadURL' => "https://mywebsite.com/img/upload/",
'uploadDir' => "/home/XXXXXXX/public_html/img/upload/", 
'theme' => "default",

Try to close the browser and restart again after changing that code. It works in goDaddy hosting. And I use sub domain to access the image by using https://img.mywebsite.com/upload/ ....the image.



来源:https://stackoverflow.com/questions/28212432/ckeditor-and-kcfinder-image-preview-on-godaddy

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