Kindeditor changes the path of the network image when the image is uploaded

Source: Internet
Author: User

When we want to use the kindeditor image upload function, there are two options: Local selection and image space selection, the default address of the image space is/kindeditor/attached/image/or lower on the server.

If you want to change the path, you need to find the/kindeditor/PHP/file_manager_json.php file, and then you can see the following lines:

// Specifies the absolute path of the root folder, for example,/var/www/attached/$ root_path = $ php_path. '.. /attached/'; // specifies the absolute path of the root folder, for example, http://www.yoursite.com/attached/?root_url = $ php_url. '.. /attached/'; // image extension $ ext_arr = array ('gif', 'jpg', 'jpeg ', 'png', 'bmp '); // folder name $ dir_name = empty ($ _ Get ['dir'])? '': Trim ($ _ Get ['dir']); If (! In_array ($ dir_name, array ('', 'image', 'flash', 'Media ', 'file') {echo" invalid directory name. "; exit;} if ($ dir_name! = '') {$ Root_path. = $ dir_name."/"; $ root_url. = $ dir_name."/"; if (! File_exists ($ root_path) {mkdir ($ root_path );}}

At the beginning of the year, I changed the addresses of $ root_path and $ root_url and found no effect. I printed $ dir_name using file_put_contents () and found that the default value is image. That is to say, after I changed the path to IMG, the path of the image space is the image below IMG. Therefore, I deleted several rows under the folder name and the modification was successful.

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.