When I used CKEditor last year, I felt that I was not very familiar with it. I have studied it again today and found many problems. On IE10, The CKEditor toolbar editor is no longer displayed, no matter how it works, IE10 has a compatibility problem with CKEditor after the result is queried. As a result, I tried it on the Chrome browser. No problem. Haha, it turns out that IE still needs to develop.
Let's just put it down. I will provide you with detailed steps for your study today. If you have any questions, please leave a message.
Download the source code files CKEditor and CKFinder.LocationAddress http://download.csdn.net/detail/heikeyuit/5476719
Or: http://ishare.iask.sina.com.cn/f/37149751.html
1. download the latest CKEditor and CKFinder on the official website (http://cksource.com. Here is the version and example I uploaded.
2. There are a lot of things in the two folders, And the content is comprehensive, but we use not all things, so we select what we need to add to the project. In the project, CKEditor and CKFinder contain files.
3. Add code to the foreground
4. CKEditor does not provide its own upload function. Therefore, you must use CKFinder to upload files.
(1) Add reference CKFinder. dll to the Project
(2) Configure CKEditor's config. js (directory:/CKEditor/config. js) and add it to the CKEDITOR. editorConfig function. unwanted features can be removed.
The Code is as follows:
= ckfinderPath = = ckfinderPath + = ckfinderPath + = ckfinderPath + = ckfinderPath + = ckfinderPath + = ckfinderPath +
After the configuration is complete, CKEditor provides the upload function. However, if you upload images, flash files, and other files with the original file name, duplicate names may occur,
So we need to change the file name to a random file name.
5. Modify the CKFinder source code. CKFinder comes with source code, directory:/CKFinde/_ source, open the project,
(1) Open the/Settings/ConfigFile. cs file and modify the file. For details, see the special mark.
====. HideFolders = [. HideFiles = [=== ForceSingleExtension ===== [= [=/* ----- the content following ------------*/
(2) Open the/Connector/Config. cs file,
Locate about 60 rows and add an attribute:
{
(3) Open the/Connector/CommandHandlers/FileUploadCommandHandler. cs file and add a judgment code. The following shows some code, which has been marked
sFileName= iErrorNumber = sFilePath = sUnsafeFileName = ( != ( HttpContext.Current.Request.Files[] != = HttpContext.Current.Request.Files[ ( HttpContext.Current.Request.Files[] != = HttpContext.Current.Request.Files[ ( HttpContext.Current.Request.Files.AllKeys.Length > = HttpContext.Current.Request.Files[HttpContext.Current.Request.Files.AllKeys[ ( oFile != == == sFileName.Replace(, = Regex.Replace( sFileName, , ( sFileName !== ( Connector.CheckFileName( sFileName ) && ! ( !Config.Current.CheckSizeAfterScaling && .CurrentFolder.ResourceTypeInfo.MaxSize > && oFile.ContentLength > sExtension == sExtension.TrimStart(
4) regenerate the project. In the bin folder, locate CKFinder. dll and add a reference to CKFinder. dll for the first project. The last step is to open/ckfinder/config. ascx.
In SetConfig (), add a property: (in fact, this addition and not adding are acceptable, because the default value has been set before, but must be set to false when using the original name)
RandomReName = true; // use a random file name after uploading
Now the configuration is successful.My code source files, http://download.csdn.net/detail/heikeyuit/5476719 for CKEditor and CKFinder
Or: http://ishare.iask.sina.com.cn/f/37149751.html
Show you the effects of my projects
6. After the configuration is successful, I found that if I want to query the path of the uploaded file in my project, one method is to query the BaseUrl Based on the configuration item ,, after adding some paths, you can query the path of the uploaded file, but this is really not very good. The second method is to modify the example and add references to it, then I added a call to a function or attribute, but this was a huge workload. I finally jumped over and called it. Finally, I felt someone else had encapsulated something, if you change the access permissions of some codes, you may mistakenly modify the important parts of the Code in the future. This is not good, so if you really want to call the code in it, I hope you can useAssembly-ReflectionThis method is really effective and will not be changed to the Assembly content.
Well, let's talk a little bit about it. Now we hope you can provide a good solution for the compatibility between IE and CKEditor.
My code source file, CKEditor and CKFinderHttp://download.csdn.net/detail/heikeyuit/5476719
Or: http://ishare.iask.sina.com.cn/f/37149751.html