Getting 404 error while editing with ckeditor

Here I insert the record using ckeditor and upload the image using ckeditor. When I am about to insert an image during upload, I can upload the image using kcfinder. At that time, I get a link to insert an image like: (When I get a link as http://localhost/project/ABC/policies/add )

 http://localhost/svn_project/PMS/resource/kcfinder/browse.php?opener=ckeditor&type=images&CKEditor=description&CKEditorFuncNum=1&langCode=en 

But, when I want to edit this entry to load the image, it shows worng url like (When I get the link as http://localhost/project/ABC/policies/edit/2 )

 http://localhost/svn_project/PMS/hr_policies/resource/kcfinder/browse.php?opener=ckeditor&type=images&CKEditor=description&CKEditorFuncNum=1&langCode=en 

In config.js ckeditor,

 CKEDITOR.editorConfig = function(config) { // Define changes to default configuration here. // For complete reference see: // http://docs.ckeditor.com/#!/api/CKEDITOR.config config.filebrowserBrowseUrl = '../resource/kcfinder/browse.php?opener=ckeditor&type=files'; config.filebrowserImageBrowseUrl = '../resource/kcfinder/browse.php?opener=ckeditor&type=images'; config.filebrowserFlashBrowseUrl = '../resource/kcfinder/browse.php?opener=ckeditor&type=flash'; config.filebrowserUploadUrl = '../resource/kcfinder/upload.php?opener=ckeditor&type=files'; config.filebrowserImageUploadUrl = '../resource/kcfinder/upload.php?opener=ckeditor&type=images'; config.filebrowserFlashUploadUrl = '../resource/kcfinder/upload.php?opener=ckeditor&type=flash'; config.removeDialogTabs = 'link:advanced'; }; 

So what should I do during editing so that I can upload the image.?

+5
source share
2 answers

I think this may be due to the way you provided your URLs in your configuration.

You have...

 config.filebrowserBrowseUrl = '../resource/kcfinder/browse.php?opener=ckeditor&type=files'; 

Instead, try pointing it out from the root of your site. Assuming your resource folder is at the root of your site, this will be ...

 config.filebrowserBrowseUrl = '/resource/kcfinder/browse.php?opener=ckeditor&type=files'; 

Make this change for each of your configuration URLs (config.filebrowserImageBrowseUrl, config.filebrowserFlashBrowseUrl, etc.)

Good luck Tom

+3
source

It may be a path error in config.php.

The path relative to the document root (this part is after the domain name).

$ Config ['UserFilesPath'] = '/ files /'; The absolute server path to the same directory is above $ Config ['UserFilesAbsolutePath'] = "/home/login/public_html/example.com/files/";

Note: $ Config ['UserFilesPath'] = ' http://example.com/files/ '; fine.

but: $ Config ['UserFilesAbsolutePath'] = " http://example.com/files/ " is incorrect.

0
source

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


All Articles