Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 谁配置过百度编辑器ueditor1.4.3的图片上传路径?

谁配置过百度编辑器ueditor1.4.3的图片上传路径?

Jun 23, 2016 pm 01:48 PM
upload editor path Configuration

搞了个百度编辑器,其他啥都配置好了,就是图片路径搞不定,图片总是跑到文件夹外面自动创建文件夹,哪位知道具体怎么配置吗,百度这个简直有地点坑爹了..


回复讨论(解决方案)

对了,还有如何给kindeditor编辑器增加上传文件时自动在文件前面生成个小图标而不是上传路径..

上传路径,在PHP文件里面改,很方便的。
置于,你说的那个小图片,就不容易了,得改编辑器源码!

上传路径,在PHP文件里面改,很方便的。
置于,你说的那个小图片,就不容易了,得改编辑器源码!

不知道你说的在php那个文件里面改,我在config.json里面改不起作用,要么就是文件路径配置不对,但是其他的我还没发现。

api不是有啊,仔细看看

你不是在 config.json 中配置的吗?
他的默认值是
"imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"
注意那是个绝对路径的,也应该是绝对路径,因为在网站的任何目录下都有可能使用 ueditor
改成你需要的就可以了

api不是有啊,仔细看看


问题是找不着么?

你不是在 config.json 中配置的吗?
他的默认值是
"imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"
注意那是个绝对路径的,也应该是绝对路径,因为在网站的任何目录下都有可能使用 ueditor
改成你需要的就可以了


改了,改过后的上传图片文件却在文件夹外了

你是怎么改的?
前面我说漏了,虽然那是一个绝对路径,但他是基于 url 的
也就是说网站的根,就是他的根

但你要确认你的 $_SERVER['DOCUMENT_ROOT'] 有值且是正确的
因为他是这样计算的

    /**     * 获取文件完整路径     * @return string     */    private function getFilePath()    {        $fullname = $this->fullName;        $rootPath = $_SERVER['DOCUMENT_ROOT'];        if (substr($fullname, 0, 1) != '/') {            $fullname = '/' . $fullname;        }        return $rootPath . $fullname;    }
Copy after login
Copy after login

你是怎么改的?
前面我说漏了,虽然那是一个绝对路径,但他是基于 url 的
也就是说网站的根,就是他的根

但你要确认你的 $_SERVER['DOCUMENT_ROOT'] 有值且是正确的
因为他是这样计算的

    /**     * 获取文件完整路径     * @return string     */    private function getFilePath()    {        $fullname = $this->fullName;        $rootPath = $_SERVER['DOCUMENT_ROOT'];        if (substr($fullname, 0, 1) != '/') {            $fullname = '/' . $fullname;        }        return $rootPath . $fullname;    }
Copy after login
Copy after login


我直接在config.json里面把:
"imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */改成我自己的路径
"imagePathFormat": "/uploadfiles/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
上传成功后生成图片文件夹直接跑到本文件夹外面去了

$_SERVER['DOCUMENT_ROOT']  .  ["imagePathFormat"]
总是保存在这里的

$_SERVER['DOCUMENT_ROOT']  .  ["imagePathFormat"]
总是保存在这里的


Forbidden
You don't have permission to access /xyjc_intranet/admin_xyjcylogin/include/ueditor/dialogs/image/image.html on this server.
不知道这是怎么回事?直接没有权限访问路径了

都好几天了,到现在你也没说你是怎么写的

我是什么都没写,现在换成ueditor1_3_5-utf8-php版本的,上传图片路径可以在config.php里面直接配置,现在的问题是我把编辑器窗口调用出来了,但是上传插件却提示个这玩意。

我之前也遇到过,imagePathFormat": "/uploadfiles/image/{yyyy}{mm}{dd}/{time}{rand:6}", /这是你的修改对吧,你在/uploadfiles前面加上你在www文件下项目的名称文件就好了..我猜他是自动寻找匹配的项目文件名若是没有就会在外围生成一个Ueditor文件的..你试试

我之前也遇到过,imagePathFormat": "/uploadfiles/image/{yyyy}{mm}{dd}/{time}{rand:6}", /这是你的修改对吧,你在/uploadfiles前面加上你在www文件下项目的名称文件就好了..我猜他是自动寻找匹配的项目文件名若是没有就会在外围生成一个Ueditor文件的..你试试


这个方法是不行的

不是很明确吗?没有访问权限!
配置目录,这个是回避不掉的
你总是要将目录弄正确了才行,并且这个目录还必须要在网站范围内
因为里面的图片要在页面中显示

不是很明确吗?没有访问权限!
配置目录,这个是回避不掉的
你总是要将目录弄正确了才行,并且这个目录还必须要在网站范围内
因为里面的图片要在页面中显示


都快郁闷死了都,明显编辑器文件夹都在网站跟目录下,现在是图片可以上传,附件却是没有权限了...凌乱了

很简单:
1、给出完整的错误信息
2、给出你的配置路径
3、各处你的网站根目录的路径

你不愿意分析,自然有人帮你分析

刚刚在我的emlog网站中弄好,测试一切正常。以前一直用uedit1.0版本,最近更新了网站程序,顺便也更新下ueditor。使用中发现上传的文件默认配置为网站根目录/uedit/php/下,而我的博客放在网站根目录/blog下,所以造成诸多不便。研究了一天,就是没发现在哪里改,因为一直忽略了这个config.json文件,看到大家的提示后,在里面修改成功!

经验:一定要用绝对路径来改,里面全是上传各种类型文件的配置,所以都要改过哦。

详情查阅:http://netv.gnway.net/blog/?post=43

Statement of this Website
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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The working principle and configuration method of GDM in Linux system The working principle and configuration method of GDM in Linux system Mar 01, 2024 pm 06:36 PM

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

Different uses of slashes and backslashes in file paths Different uses of slashes and backslashes in file paths Feb 26, 2024 pm 04:36 PM

A file path is a string used by the operating system to identify and locate a file or folder. In file paths, there are two common symbols separating paths, namely forward slash (/) and backslash (). These two symbols have different uses and meanings in different operating systems. The forward slash (/) is a commonly used path separator in Unix and Linux systems. On these systems, file paths start from the root directory (/) and are separated by forward slashes between each directory. For example, the path /home/user/Docume

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to upload lyrics to QQ Music How to upload lyrics to QQ Music Feb 23, 2024 pm 11:45 PM

With the advent of the digital age, music platforms have become one of the main ways for people to obtain music. However, sometimes when we listen to songs, we find that there are no lyrics, which is very disturbing. Many people hope that lyrics can be displayed when listening to songs to better understand the content and emotions of the songs. QQ Music, as one of the largest music platforms in China, also provides users with the function of uploading lyrics, so that users can better enjoy music and feel the connotation of the songs. The following will introduce how to upload lyrics on QQ Music. first

Simple steps to upload your own music on Kugou Simple steps to upload your own music on Kugou Mar 25, 2024 pm 10:56 PM

1. Open Kugou Music and click on your profile picture. 2. Click the settings icon in the upper right corner. 3. Click [Upload Music Works]. 4. Click [Upload Works]. 5. Select the song and click [Next]. 6. Finally, click [Upload].

Introduction to Go language development tools: a list of essential tools Introduction to Go language development tools: a list of essential tools Mar 29, 2024 pm 01:06 PM

Title: Introduction to Go language development tools: List of essential tools In the development process of Go language, using appropriate development tools can improve development efficiency and code quality. This article will introduce several essential tools commonly used in Go language development, and attach specific code examples to allow readers to understand their usage and functions more intuitively. 1.VisualStudioCodeVisualStudioCode is a lightweight and powerful cross-platform development tool with rich plug-ins and functions.

How to configure and install FTPS in Linux system How to configure and install FTPS in Linux system Mar 20, 2024 pm 02:03 PM

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

What is the difference in the 'My Computer' path in Win11? Quick way to find it! What is the difference in the 'My Computer' path in Win11? Quick way to find it! Mar 29, 2024 pm 12:33 PM

What is the difference in the "My Computer" path in Win11? Quick way to find it! As the Windows system is constantly updated, the latest Windows 11 system also brings some new changes and functions. One of the common problems is that users cannot find the path to "My Computer" in Win11 system. This was usually a simple operation in previous Windows systems. This article will introduce how the paths of "My Computer" are different in Win11 system, and how to quickly find them. In Windows1

See all articles