Line 63: | Line 63: | ||
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.asp file as below:
Set ResourceTypes(0) = DefineResourceType( _ "Files", _ baseUrl & "files", _ baseDir & "files", _ 0, _ "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", _ "" _ ) Set ResourceTypes(1) = DefineResourceType( _ "Images", _ baseUrl & "images", _ baseDir & "images", _ 0, _ "bmp,gif,jpeg,jpg,png", _ "" _ ) Set ResourceTypes(2) = DefineResourceType( _ "Flash", _ baseUrl & "flash", _ baseDir & "flash", _ 0, _ "swf,flv", _ "" _ )
The above syntaz reffers to functions written bellow in the following order:
ResourceType.Add "name", name ResourceType.Add "url", url ResourceType.Add "directory", directory ResourceType.Add "maxSize", maxSize ResourceType.Add "allowedExtensions", allowedExtensions ResourceType.Add "deniedExtensions", deniedExtensions
These resources will be enabled if this option:
CKFinder_Config.Add "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 url and directory 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, separated by a comma. .
deniedExtensions - here you place all the extensions you don't wish the CKFinder to use, separated 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 except 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 integrated with FCKeditor. If so when looking through the files the editor will use the resources types specifies in the config.asp 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.