Solution to the FCKeditor upload problem after the topic is applied and corresponding improvements

Source: Internet
Author: User
Solution to the FCKeditor upload problem after the topic is applied and corresponding improvements

FCKeditor is not selected after Freetextbox charges. Preliminary use is very convenient, and the configuration is improved a lot from 2.3 to 2.2. In fckconfig. js
Var _ FileBrowserLanguage = 'aspx '; // asp | aspx | cfm | lasso | perl | php | py
Var _ QuickUploadLanguage = 'aspx '; // asp | aspx | cfm | lasso | php
Change to aspx. It is much better than 2.2.

However, the upload process has not been fixed, so I have to rush to Truly many times! With his help
Application ["FCKeditor: UserFilesPath"]
This performance may be the highest, because if you download FCKeditor. Net, you will find the following code in FileWorkerBase. cs:

1 protected string UserFilesPath
2 {
3 get
4 {
5 if (sUserFilesPath = null)
6 {
7 // Try to get from the "Application ".
8 sUserFilesPath = (string) Application ["FCKeditor: UserFilesPath"];
9
10 // Try to get from the "Session ".
11 if (sUserFilesPath = null | sUserFilesPath. Length = 0)
12 {
13 sUserFilesPath = (string) Session ["FCKeditor: UserFilesPath"];
14
15 // Try to get from the Web. config file.
16 if (sUserFilesPath = null | sUserFilesPath. Length = 0)
17 {
18 sUserFilesPath = System. Configuration. ConfigurationManager. receivettings ["FCKeditor: UserFilesPath"];
19
20 // Otherwise use the default value.
21 if (sUserFilesPath = null | sUserFilesPath. Length = 0)
22 sUserFilesPath = DEFAULT_USER_FILES_PATH;
23
24 // Try to get from the URL.
25 if (sUserFilesPath = null | sUserFilesPath. Length = 0)
26 {
27 sUserFilesPath = Request. QueryString ["ServerPath"];
28}
29}
30}
31
32 // Check that the user path ends with slash ("/")
33 if (! SUserFilesPath. EndsWith ("/"))
34 sUserFilesPath + = "/";
35}
36 return sUserFilesPath;
37}
38}

Therefore, adding Application ["FCKeditor: UserFilesPath"] To the Application_Start event of Global. asax is the best solution.

However, after several days of testing and improvement, you still cannot upload files.

After many helplessness, I finally continued to rush to Truly and used the most expensive method-telephone. I hope Truly will not charge two-way traffic!

Truly tells me that I can only add FCKeditor.net to the Project for debugging!
So I joined the project for debugging, ...... It's useless. It's useless to set more than N breakpoints!

At this point, I suddenly found a test.html file under \ FCKeditor \ editor \ filemanager \ upload.
It is an Upload debugging page, which is very convenient. You only need to select aspx to view the POST page process.
Debugging now. A bunch of errors! When I was helpless, I suddenly found that I did not place this file in the project file, and I was still extracting the package, so I copied it to the Project for debugging and prompted a request.
<Head runat = "server">
Error!
Suddenly thought of the topic! The topic of my application is written into the topic, but it needs to be loaded in Open the \ FCKeditor \ editor \ filemanager \ upload \ aspx \ Upload. aspx file and add
<Html>
<Head runat = "server">
</Head> Code, debugging ...... Nervous!
An English prompt suddenly pops up! No, it will be wrong again! Take a closer look! The message is that the file is uploaded successfully!

Finally found the problem!

To sum up, do not delete all irrelevant files when streamlining FCKeditor based on the project. For example, how can I use a debugging item like test.html under FCKeditor \ editor \ filemanager \ upload? Sometimes it is useless to set breakpoints in the source code, such as the problems caused by this topic.

In addition, due to the large number of directories in the design process, the relative path of the image becomes faulty. I wrote this in the Application_Start event of Global. asax.
Application ["FCKeditor: UserFilesPath"] = "~ /UploadFiles/UserFiles /";
Originally written
Application ["FCKeditor: UserFilesPath"] = "/UploadFiles/UserFiles /";
The result shows that the path is not found, and it is a problem with the relative directory. So I changed it to the above one. But the problem arises again. After the upload is successful, the returned html code is like this.
. In this way, it still cannot be displayed, so I found the base class of Uploader. cs to control the damage.
Set
SFileUrl = this. UserFilesPath + sFileName;
Change
SFileUrl = Request. ApplicationPath + this. UserFilesPath. Replace ("~ "," ") + SFileName;

As a result, everyone knows it! Everything is normal!
Okay, the problem is finally solved! Thank you again, Truly!

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.