New"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

Line 1: Line 1:
To create a new resource type you should place the section below in your config.php file. Note that the options you can use are discribed in the [[CKFinder/Developers Guide/ASP.NET/Configuration/Resource Types/Built-in|Built-in resource types]] section.
+
To create a new resource type you should append the following lines of code anywhere after the "ResourceType type;" line in the configuration file.
  
Example: You want to create a resource type MSdocs which will only have doc,ppt,xls extensions and be maximum 2 megabites large.
+
For example, if want to create a resource type named MSdocs which will only accept files with the "doc", "ppt" and "xls" extensions, restricting the file size to 2 megabytes:
<pre>&lt;ResourceType
+
 
name = "MSdocs"
+
<pre>type = ResourceType.Add( "MSdocs" );
url = "%BASEURL%files"
+
type.Url = BaseUrl + "docs/";
directory = "%BASEDIR%files"
+
type.Dir = BaseDir == ""&nbsp;? ""&nbsp;: BaseDir + "docs/";
maxSize = "2M"
+
type.MaxSize = 2000;
allowedExtensions = "doc,ppt,xls"
+
type.AllowedExtensions = new string[] { "doc", "ppt", "xls" };
deniedExtensions = ""
+
type.DeniedExtensions = new string[] { };</pre>  
/&gt;</pre>  
+
 
The CKFinder will use all the resources types including the one specifies by you. If you want to limit the CKFinder to use only your resource type you must place it in the '''<nowiki>default</nowiki>'''<nowiki></nowiki> field. Example'':''
+
The above options are described in the [[CKFinder/Developers Guide/ASP.NET/Configuration/Resource Types/Built-in|Built-in resource types]] section.
<pre>&lt;ResourceTypes
+
 
default = "MSdocs"
+
By default, CKFinder will use all the resources types including the new one you have just created. If you want to limit the CKFinder to use only your resource type you must place its name in the in the '''DefaultResourceTypes''' setting. For example:
&gt;</pre>  
+
 
{{DISPLAYTITLE:Adding new resource type}}
+
<pre>DefaultResourceTypes = "MSdocs";
 +
</pre>

Revision as of 19:54, 12 January 2008

To create a new resource type you should append the following lines of code anywhere after the "ResourceType type;" line in the configuration file.

For example, if want to create a resource type named MSdocs which will only accept files with the "doc", "ppt" and "xls" extensions, restricting the file size to 2 megabytes:

type = ResourceType.Add( "MSdocs" );
type.Url = BaseUrl + "docs/";
type.Dir = BaseDir == "" ? "" : BaseDir + "docs/";
type.MaxSize = 2000;
type.AllowedExtensions = new string[] { "doc", "ppt", "xls" };
type.DeniedExtensions = new string[] { };

The above options are described in the Built-in resource types section.

By default, CKFinder will use all the resources types including the new one you have just created. If you want to limit the CKFinder to use only your resource type you must place its name in the in the DefaultResourceTypes setting. For example:

DefaultResourceTypes = "MSdocs";