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
The code is as follows |
Copy Code |
Return Array (
Picture Catalogue ' Imagesavepath ' => Array ( '.. /.. /.. /.. /data/upload ' )
); |
Step two: Picture upload and remove relative path php/imageup.php
The code is as follows |
Copy Code |
$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
The code is as follows |
Copy Code |
, ImagePath: "/" |
Fourth step: If you want to modify the picture generation path or picture name
Modify picture generation path in php/uploader.class.php
The code is as follows |
Copy Code |
Private Function GetFolder () { $PATHSTR = $this->config["Savepath"]; if (STRRCHR ($PATHSTR, "/")!= "/") { &nbs p; $pathStr. = "/"; } $pathStr. = Date ("ym/d"); if (!file_exists ($PATHSTR)) { & nbsp; if (!mkdir ($pathStr, 0777, True)) { &nbs p; return false; } } return $pathStr; } |
Modify the file name, search for "Filenameformat" in Ueditor.all.min.js, and then modify it according to the Official document description!