Here, I am inserting record using ckeditor and uploading an image using ckeditor.
When I am going to insert an image at the time of adding, I can upload image using kcfinder.
At that time I am getting link proper to insert image like, ( When I get 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 that record to upload an image, it shows worng url like, (When I get 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 of 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 at the time of edit, that I can upload an image.?
I think it may have to do with the way you specified your URLs in your configuration.
You have...
config.filebrowserBrowseUrl = '../resource/kcfinder/browse.php?opener=ckeditor&type=files';
Instead, try listing it from the root of your site. Assuming that your "resource" folder is in the root of your website, it would be...
config.filebrowserBrowseUrl = '/resource/kcfinder/browse.php?opener=ckeditor&type=files';
Make that change for each of your config URLs (config.filebrowserImageBrowseUrl, config.filebrowserFlashBrowseUrl, etc...)
Good luck! Tom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With