Line 35: | Line 35: | ||
is left empty. You may specify what resources types you want to use by placing their names separated by a comma. | is left empty. You may specify what resources types you want to use by placing their names separated by a comma. | ||
− | === Changing the default resources === | + | === Changing the default resources === |
Every resource type has several options which you may change. | Every resource type has several options which you may change. | ||
+ | |||
− | '''url''' and '''directory''' - you can place any url adress and directory you wish but be sure that their specification will follow the rules reffering to '''$baseUrl''' and '''$baseDir''' in the [[CKFinder/Developers Guide/PHP/Configuration/Quick Start|Quick Start]] section. | + | '''url''' and '''directory''' - you can place any url adress and directory you wish, but be sure that their specification will follow the rules reffering to '''$baseUrl''' and '''$baseDir''' in the [[CKFinder/Developers Guide/PHP/Configuration/Quick Start|Quick Start]] section. |
+ | |||
'''maxSize''' - is the maximum size of the uploaded image defined in bytes.You may also use shorthand notation. Available options are: G, M, K (case insensitive). Remember that: 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte. Example: 'maxSize' => "8M", | '''maxSize''' - is the maximum size of the uploaded image defined in bytes.You may also use shorthand notation. Available options are: G, M, K (case insensitive). Remember that: 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte. Example: 'maxSize' => "8M", | ||
+ | |||
'''allowedExtensions''' - here you place all the extensions you wish the CKFinder to use, seperated by a comma. . | '''allowedExtensions''' - here you place all the extensions you wish the CKFinder to use, seperated by a comma. . | ||
+ | |||
'''deniedExtensions''' - here you place all the extensions you don't wish the CKFinder to use, seperated by a comma. | '''deniedExtensions''' - here you place all the extensions you don't wish the CKFinder to use, seperated by a comma. | ||
+ | |||
− | <br>'''Important''': if you leave '''allowedExtensions''' empty and | + | <br>'''Important''': if you leave '''allowedExtensions''' empty and add something in '''deniedExtensions''' e.g.pdf, it will allow the upload of all the files exept the pdf. However it isn't a good way to secure your server from unwanted uploads. The best way is to use the whitelist approach and put all of the prefered extensions in '''allowedExtensions''' array. Only in this way you will secure your server from junk. |
== FCKeditor issues == | == FCKeditor issues == |
Revision as of 15:31, 15 December 2008
Contents
Default resources
Resources types
There are three built-in resources types in CKFinder: files, images and flash. They appear in the config.php file as below:
$config['ResourceType'][] = Array( 'name' => 'Files', // Single quotes not allowed 'url' => $baseUrl . 'files', 'directory' => $baseDir . 'files', 'maxSize' => 0, 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xml,zip', 'deniedExtensions' => ''); $config['ResourceType'][] = Array( 'name' => 'Images', 'url' => $baseUrl . 'images', 'directory' => $baseDir . 'images', 'maxSize' => 0, 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png', 'deniedExtensions' => ''); $config['ResourceType'][] = Array( 'name' => 'Flash', 'url' => $baseUrl . 'flash', 'directory' => $baseDir . 'flash', 'maxSize' => 0, 'allowedExtensions' => 'swf,flv', 'deniedExtensions' => '');
These resources will be enabled if this option:
$config['DefaultResourceTypes'] = '';
is left empty. You may specify what resources types you want to use by placing their names separated by a comma.
Changing the default resources
Every resource type has several options which you may change.
url and directory - you can place any url adress and directory you wish, but be sure that their specification will follow the rules reffering to $baseUrl and $baseDir in the Quick Start section.
maxSize - is the maximum size of the uploaded image defined in bytes.You may also use shorthand notation. Available options are: G, M, K (case insensitive). Remember that: 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte. Example: 'maxSize' => "8M",
allowedExtensions - here you place all the extensions you wish the CKFinder to use, seperated by a comma. .
deniedExtensions - here you place all the extensions you don't wish the CKFinder to use, seperated by a comma.
Important: if you leave allowedExtensions empty and add something in deniedExtensions e.g.pdf, it will allow the upload of all the files exept the pdf. However it isn't a good way to secure your server from unwanted uploads. The best way is to use the whitelist approach and put all of the prefered extensions in allowedExtensions array. Only in this way you will secure your server from junk.
FCKeditor issues
CKFinder may be intergrated with FCKeditor. If so when looking througout the files the editor will use the resources types specifies in the config.php file of the CKFinder. To instead configure FCKeditor manually to use CKFinder, just edit the fckconfig.js file in the FCKeditor directory and modify the following settings:
FCKConfig.LinkBrowserURL = '/ckfinder/ckfinder.html' ; FCKConfig.ImageBrowserURL = '/ckfinder/ckfinder.html?type=Images' ; FCKConfig.FlashBrowserURL = '/ckfinder/ckfinder.html?type=Flash' ;
Just change "/ckfinder/" in the above URLs if you have CKFinder installed in a different place.