Preview image of CKEditor and KCfinder on GoDaddy

I had a problem previewing the image through KCFinder on CKEditor on the GoDaddy hosting.

When I select an image from KCFinder, the preview loads correctly on my local computer, but when I check GoDaddy, it does not display correctly. The difference can be seen from the following images.

I configured the file browser in CKEditor as shown below.

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; 

Preview image in my localhost.

Image on local machine

Preview image hosted by GoDaddy

enter image description here

The main problem: I cannot get the "upload /" directory in the url. You can see the difference in the images above.

Can anyone help how to solve this problem?

Thanks in advance.

+6
source share
4 answers

I used the absolute path for uploadURL and it will work!

+2
source

Go to the conf folder inside " kcfinder ", then open the upload.htaccess file and delete all the text from this file (upload.htaccess). Finally save it.

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

I hope this is better.

0
source

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

0
source

I had the same problem googling for a solution and I found this site. But finally, I solve the problem and let me share here.

Just put the image x in the text area. Using the source menu, check the image URL. See what the problem is. If you find something like / plugins / ckeditor / file -manager / yourweb.com / ...., it means that you do not put http: // in the download directory. It should be like this:

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

Try closing the browser and restarting it after changing this code. He works in hosting goDaddy. And I use a subdomain to access the image using https://img.mywebsite.com/upload/ .... image.

0
source

Source: https://habr.com/ru/post/981706/


All Articles