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":