How to modify the uploaded image or file path in the UEditor editor
Use ueditor editor. The attachment is in ueditor/php/upload/ by default. My attachment address is /data/upload/ in the root directory of the website. You need to modify ueditor as follows:
Step 1: Open php /config.php Modify the image directory
return array( //图片目录 'imageSavePath' => array ( '../../../../data/upload' ) );
Step 2: Remove the relative path after uploading the image php/imageUp.php
$info["url"]=str_replace('../../../../', '', $info["url"]); echo "{'url':'" . $info["url"] . "','title':'" . $title . "','original':'" . $info["originalName"] . "','state':'" . $info["state"] . "'}"; exit;
Step 3: Open ueditor.config.js to modify the image path
,imagePath:"/"
Step 4: If you want to modify the image generation path or image name
Modify the image generation path in php/Uploader.class.php
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 file name in Search "fileNameFormat" in ueditor.all.min.js, and then modify it according to the official documentation!
For more related articles on how to modify the UEditor editor’s custom uploaded image or file path, please pay attention to the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
