FCKeditor Editor Add picture upload function and picture path problem Solving Method _ Web page Editor

Source: Internet
Author: User
Tags file upload

Now many CMS system for security reasons will be the background editor in the upload function to remove, but this to the actual use of the process caused a lot of trouble, today we take the ASPCMS system FCKeditor editor As an example, explain how to increase the image upload function.

1. Open the Admin/editor/fckconfig.js this file in the website backstage editor

Find the sentence Fckconfig.imageupload = False, and change false to true.

Fckconfig.imagebrowser = false; This also changes false to True

2. Take a look at the FileManager folder below the Admin/editor/editor directory, and if not, download a version of the FCK editor above 2.6.3 and copy the FileManager folder inside. Of course, this is the ASP, so other languages like PHP What folder can be deleted.

3. Next set the path of the file upload, open the Admin/editor/filemanager/connectors/asp folder config.asp this file to set the following

configisenabled = True Whether the upload function is turned on

Configuserfilespath = ".. /.. /.. /.. /.. /uploads/"File upload directory, relative to this folder

Here to highlight the Configuserfilespath = ". /.. /.. /.. /.. /uploads/"Here if this setting, I finally found two questions

A Configuserfilespath = ".. /.. /.. /.. /.. /uploads/"This setting although the picture can be uploaded, but the picture path to insert editor is problematic, so I tried many times finally to change it to Configuserfilespath ="/uploads/"on it. You can also set Configuserfilespath = "folder name/uploads/" If your site is placed in a subordinate folder.

B As for the second question, I feel strange, the FCKeditor editor's picture path will appear two slashes//, although the picture can also show, but it seems to be uncomfortable. Please open the Admin/editor/editor/filemanager/connectors/asp folder, io.asp This file, please put:

function Combinepaths (Sbasepath, Sfolder)

Combinepaths = Removefromend (Sbasepath, "/") & "/" & Removefromstart (Sfolder, "/")

End Function

Change into

function Combinepaths (Sbasepath, Sfolder)

Sfolder = replace (Sfolder, "", "/")

Combinepaths = Removefromend (Sbasepath, "/") & "/" & Removefromstart (Sfolder, "/")

End Function

4. Finally set the uploaded image automatically renamed, please open the Admin/editor/editor/filemanager/connectors/asp folder in the commands.asp this file

Add the following statement to the file

Dim rannum

Dim Dtnow

Dim getnewfilename

Dtnow=now ()

Randomize

Rannum=int (90*RND) +10

Getnewfilename=year (Dtnow) & Right ("0" & Month (Dtnow), 2) & Right ("0" & Day (Dtnow), 2) & Right ("0" & Hour (Dtnow), 2) & Right ("0" "& Minute (Dtnow), 2) & Right (" 0 "& Second (Dtnow), 2) & Rannum

and will

sFileName = Ouploader.file ("NewFile") name

To

sFileName = Getnewfilename & "." & Split (Ouploader.file ("NewFile"). Name, "." (1)

The above is a little bit of improvement on the ASPCMS website system, I hope to be helpful to friends who need it, we will pay attention to other problems of the system in the future.

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.