FCKeditor configuration and extension-only applicable to ASP. NET

Source: Internet
Author: User

1. Customize the basepathbasepath of FCKeditor, that is, the relative path of FCKeditor on the website. The default value is/FCKeditor/. It is best to configure it in Web. config appsettings:

<Add key = "FCKeditor: basepath" value = "/fckeditor_2.6.3/"/>

This method has many advantages:

1. the development environment is different from the production environment. The development environment is generally http: // localhost/hosts;
In addition, because the physical directory structure is different from the logical directory structure, errors may also occur;
If Web. config is used, different configurations can be used in the development environment. The physical path of FCKeditor is consistent with that of the production environment;
2. When upgrading FCKeditor, you only need to put the new version of FCKeditor in the directory of the corresponding version number and modify the configuration. In this way, different users may encounter different errors due to the client cache of static resources;
3. You can see the version number of your FCKeditor.

Ii. Configuration File Upload directory
You can configure the File Upload (multipart upload) Directory of FCKeditor through web. config appsettings, for example:

<Add key = "FCKeditor: userfilespath" value = "/uploadfile/FCKeditor/"/>

You can also go to/fckeditorbasepath/Editor/filemanager/connectors/aspx/config. configure in ascx, but I recommend that you do not change the content in the FCKeditor directory (fckconfig. except Js.

Iii. Format of subdirectories uploaded by custom files
We know that a folder cannot store too many files (it is said that 2000 of the Windows directory is the threshold), otherwise access to this directory will seriously affect I/O performance. FCKeditor files are stored in a single directory. I have extended FCKeditor to customize the format of the storage directory in Web. config appsettings, for example:

<Add key = "FCKeditor: folderpattern" value = "% Y/% m-% d/"/>

Take today's date as an example: the format of the generated file upload sub-directory is 2008/10-21 /.
Directories in the format of year, month, and day can be combined at will, for example:

<Add key = "FCKeditor: folderpattern" value = "% Y/% m/% d/"/>

This generated file upload subdirectory is changed to 2008/10/21/

Refer:

% Y indicates the year of the current time
% M indicates the month of the current time
% D indicates the day of the current time

Iv. Custom File Upload File Name format
FCKeditor processes file names according to the following rules: If there are no duplicate files in the current directory, the uploaded file names are the same as those in the user's PC; if there are n duplicate files, the file name added to the user's PC is example. XXX, the uploaded file name becomes: Example (n ). xxx

My project requires that the file name uploaded by the user be changed to the guid format, so I have extended the FCKeditor, in the web. config ettings can customize the format of the uploaded file, for example:

<Add key = "FCKeditor: filenamepattern" value = "% guid. % extl"/>

Such a file name as a299e63a-7d2d-493d-bbb9-99162ef5b6b8.gif

Refer:

% Guid indicates a new guid string
% FNL indicates the lower case of the source file name
% FNU indicates the capital of the source file name
% Extl indicates the lower case of the source file extension
% Extu indicates the upper case of the source file extension.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.