I'm trying to set up CKFinder with CKEditor and have a problem.
Is there any solution or workaround to set different upload paths to multiple textareas in single page?
It will be better if external parameters could override the default values.
Thank you.
Is there any solution or workaround to set different upload paths to multiple textareas in single page?
It will be better if external parameters could override the default values.
Thank you.
Re: How to set different upload paths to multiple textareas?
If you're using php, this might help.
Code in page that contains the textareas:
$CKEditor = new CKEditor();
$CKEditor->basePath = '/ckeditor/';
$CKEditor->config['customConfig'] = 'configOne.js.php';
$CKEditor->replace("textarea1");
$CKEditor->config['customConfig'] = 'configTwo.js.php';
$CKEditor->replace("textarea2");
----------------------------------------------------------
In your config files use different "types".
type=Images1
type=Images2
configOne.js.php
CKEDITOR.editorConfig = function( config )
{
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?type=Images1';
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images1';
};
configTwo.js.php
CKEDITOR.editorConfig = function( config )
{
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?type=Images2';
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images2';
};
---------------------------------------------------------------
In your CKFinder config.php use:
$config['ResourceType'][] = Array(
'name' => 'Images1',
'url' => $baseUrl . 'images1',
'directory' => $baseDir . 'images1',
'maxSize' => "16M",
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png,avi,iso,mp3',
'deniedExtensions' => 'php,inc');
$config['ResourceType'][] = Array(
'name' => 'Images2',
'url' => $baseUrl . 'images1',
'directory' => $baseDir . 'images2',
'maxSize' => "16M",
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png,avi,iso,mp3',
'deniedExtensions' => 'php,inc');
Good Luck,
Joe