Home > Backend Development > PHP Tutorial > Joomla jce editor solves the problem of failure to upload Chinese name files_PHP tutorial

Joomla jce editor solves the problem of failure to upload Chinese name files_PHP tutorial

WBOY
Release: 2016-07-21 15:06:42
Original
924 people have browsed it

Neither JCE nor CKEDITOR has solved the problem of files with Chinese names. Either the upload fails, or the uploaded Chinese names cannot be accessed by the web. In contrast, JCE is more user-friendly. For example, after a file is uploaded, it is selected by default, and users do not need to browse up and down in such a small pop-up window to search for the file they just uploaded. After studying the source code of JCE, I changed the way of saving file names and used pure numbers as file names.

Go to the directory where joomla is installed, find components/com_jce/editor/extensions/browser/file.php, and modify lines 1017 - 1020:

Copy the code The code is as follows:

// strip extension
$name = WFUtility::stripExtension($name);
// make file name 'web safe'
$ name = WFUtility::makeSafe($name, $this->get('websafe_mode', 'utf-8'));

changed to
Copy code The code is as follows:

$name = date('Ymd-His-', time()).rand(999);

My joomla version is 1.5 and JCE version 2.1.3. The modified positions of different versions may be slightly different.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327590.htmlTechArticleNeither JCE nor CKEDITOR has solved the problem of Chinese name files. Either the upload failed or the Chinese name was uploaded. The name cannot be accessed by the web. In contrast, JCE is more user-friendly, such as files...
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template