m |
|||
Line 52: | Line 52: | ||
FCKConfig.FlashBrowserURL = '/ckfinder/ckfinder.html?type=Flash' ; | FCKConfig.FlashBrowserURL = '/ckfinder/ckfinder.html?type=Flash' ; | ||
</pre> | </pre> | ||
− | Just change "/ckfinder/" in the above URLs if you have CKFinder installed in a different place. {{CUSTOMTITLE:Built-in resource types}} | + | Just change "/ckfinder/" in the above URLs if you have CKFinder installed in a different place. {{#CUSTOMTITLE:Built-in resource types}} |
Revision as of 18:29, 30 January 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[1] = structNew(); config.resourceType[1].name = 'Files'; config.resourceType[1].url = config.baseUrl & 'files'; config.resourceType[1].directory = config.baseDir & 'files'; config.resourceType[1].maxSize = 0; config.resourceType[1].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'; config.resourceType[1].deniedExtensions = ''; config.resourceType[2] = structNew(); config.resourceType[2].name = 'Images'; config.resourceType[2].url = config.baseUrl & 'images'; config.resourceType[2].directory = config.baseDir & 'images'; config.resourceType[2].maxSize = 0; config.resourceType[2].allowedExtensions = 'bmp,gif,jpeg,jpg,png'; config.resourceType[2].deniedExtensions = ''; config.resourceType[3] = structNew(); config.resourceType[3].name = 'Flash'; config.resourceType[3].url = config.baseUrl & 'flash'; config.resourceType[3].directory = config.baseDir & 'flash'; config.resourceType[3].maxSize = 0; config.resourceType[3].allowedExtensions = 'swf,flv'; config.resourceType[3].deniedExtensions = '';
These resources will be enabled if this option:
config.defaultResourceTypes = '';
is left empty. If not 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 you will put 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 put all of the prefered extensions in allowedExtensions and put the unwanted ones in the deniedExtensions. 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.