Extended FCKeditor Editor's picture upload function

Source: Internet
Author: User

In my personal blog (MR.D ' time), backstage articles are published using the FCKeditor editor, which allows you to use the provided image upload function in the FCKeditor editor with a simple configuration. But did not provide to the upload after the picture manages, so that I can not meet the future of various applications, such as: the use of uploaded files, delete uploaded files and so on, so that in the blog, encountered the "to insert pictures in the article" Such an application so that my operation is very cumbersome (upload pictures---Remember the file--- Write the URL by hand, so I can't enjoy the pleasure of blogging. So I have the idea of extending the FCKeditor editor image upload function.

Analyze image upload process for FCKeditor editor

In the FCKeditor editor, the image upload function is through the "dialog" directory in the "fck_image.html" page through the form of the post way to the server page, and the server page further upload processing. Upload the form's code like "Figure One":

The URL address that is submitted to the server page is the value of "action=" in the figure above, which is configured through a configuration file (Fckconfig.js), which is very flexible and makes my extension of this feature very convenient. By modifying the "fckconfig.imageuploadurl" option in the configuration file, you can change the submit address so that the upload page that I produced receives the stream of data that was post. Configuration options such as "Figure II":

Although through this configuration, the form will be submitted to the page address as shown in the figure, when it changes the value of the action in figure I, it is through the "dialog" directory under the "Fck_image" directory under the "Fck_image.js" The file modifies the action's value in the Window.onload event to the Fckconfig.imageuploadurl value in the configuration file. Modify the code like "figure three":

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.