search
Homephp教程php手册thinkPHP3.2关于Ueditor1.4.3文件上传路径的问题

不需整合thinkPHP和Ueditor直接使用的方法。
整合方法的看http://www.thinkphp.cn/code/694.html(作者:zhurisoft )
其实可以修改三个地方就直接用了。本人比较懒,看了半天整合的方法,调试一下出错了,所以修改一下就源文件直接用。
1、修改uploader.class.php文件中的getFilePath()方法中的变量,大概在305行。
$rootPath = "这里面是你上传文件的根路径";
例如:$rootPath = $_SERVER['HTTP_HOST'];
2、修改config.json中的配置项:imagePathFormat(上传文件的保存路径)
imagePathFormat是你根路径下的子目录+文件名
例如:"imagePathFormat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}{filename}",
修改上面两个就地方就改变Ueditor的上传地址了。
3、要想正常在编辑器中正常读取图片就要修改config.json中的配置项:imageUrlPrefix(图片访问路径前缀 )
例如:"imageUrlPrefix": "http://localhost/你的主程序地址/Public",

AD:真正免费,域名+虚机+企业邮箱=0元

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor