(Created page with 'To create a new resource type you should place the section below in your config.cfm file. Note that the options you can use are discribed in the [[CKFinder_2.x/Developers Guide/C…') |
(Article contents proof-read and formatted, some replaced with a template) |
||
Line 1: | Line 1: | ||
− | + | {{Ckfinder_2.x_New_Resource_Types_Description|file=<code>config.cfm</code>|link=CKFinder_2.x/Developers Guide/ColdFusion/Configuration/Resource Types/Built-in}} | |
− | + | <source lang="cfm"> | |
− | < | + | config.resourceType[1] = structNew(); |
config.resourceType[1].name = 'MSdocs'; | config.resourceType[1].name = 'MSdocs'; | ||
− | config.resourceType[1].url = config.baseUrl & | + | config.resourceType[1].url = config.baseUrl & 'MSdocs'; |
− | config.resourceType[1].directory = config.baseDir & | + | config.resourceType[1].directory = config.baseDir & 'MSdocs'; |
config.resourceType[1].maxSize = "2M"; | config.resourceType[1].maxSize = "2M"; | ||
config.resourceType[1].allowedExtensions = 'doc,ppt,xls'; | config.resourceType[1].allowedExtensions = 'doc,ppt,xls'; | ||
config.resourceType[1].deniedExtensions = ''; | config.resourceType[1].deniedExtensions = ''; | ||
− | </ | + | </source> |
− | + | ||
− | < | + | {{Ckfinder_2.x_New_Resource_Types_Default|DefaultResourceTypes=defaultResourceTypes}} |
− | + | ||
+ | <source lang="cfm">config.defaultResourceTypes = 'MSdocs';</source> |
Latest revision as of 08:11, 31 March 2011
When you want to create a new resource type, you should place the section below in your config.cfm
file. Note that the options you can use are described in the Handling Built-in Resource Types section.
Example: Suppose you want to create a new resource type named MSdocs
, which will only be used for files with the .doc
, .ppt
, and .xls
extensions and the maximum size of 2 megabytes. Add the following code to your configuration file.
config.resourceType[1] = structNew(); config.resourceType[1].name = 'MSdocs'; config.resourceType[1].url = config.baseUrl & 'MSdocs'; config.resourceType[1].directory = config.baseDir & 'MSdocs'; config.resourceType[1].maxSize = "2M"; config.resourceType[1].allowedExtensions = 'doc,ppt,xls'; config.resourceType[1].deniedExtensions = '';
When loading CKFinder, the type
querystring parameter can be used to display a specific type only. If type
is omitted in the URL, the defaultResourceTypes
setting is used (it may contain the resource type names separated by a comma).
If the defaultResourceTypes
setting is left empty, all types — including the newly defined ones — are loaded. When you want to limit CKFinder to only use the newly defined MSdocs
resource type, use the following code:
config.defaultResourceTypes = 'MSdocs';