Ueditor Editor Custom upload picture or file path modification Method _ Web page Editor

Source: Internet
Author: User

Using the Ueditor Editor, the attachment defaults to ueditor/php/upload/, my attachment address is/data/upload/under the site root directory, and needs to be modified Ueditor as follows:

The first step: Open php/config.php Modify the picture directory

Copy Code code as follows:

Return Array (

Picture Catalogue
' Imagesavepath ' => Array (
'.. /.. /.. /.. /data/upload '
)

);

Step two: Picture upload and remove relative path php/imageup.php

Copy Code code as follows:

$info [url]]=str_replace ('. /.. /.. /.. /', ', $info ["url"]);
echo "{' URL ': '". $info [url]. "', ' title ': '. $title. "', ' original ': '". $info ["Originalname"]. "', ' state ': '. $info ["state"]. "'}";
Exit

Step Three: Open ueditor.config.js Modify Picture path

Copy Code code as follows:

, ImagePath: "/"

Fourth step: If you want to modify the picture generation path or picture name

Modify picture generation path in php/uploader.class.php

Copy Code code as follows:

Private Function GetFolder ()
{
$PATHSTR = $this->config["Savepath"];
if (STRRCHR ($PATHSTR, "/")!= "/") {
$pathStr. = "/";
}
$pathStr. = Date ("ym/d");
if (!file_exists ($PATHSTR)) {
if (!mkdir ($pathStr, 0777, True)) {
return false;
}
}
return $pathStr;
}

Modify the filename, search for "Filenameformat" in Ueditor.all.min.js, and then modify it according to the Official document description!

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.