Joomlajceeditor solves the problem of uploading a Chinese name File _ PHP Tutorial

Source: Internet
Author: User
Joomlajceeditor solves the problem of uploading a Chinese name file. No matter whether it is JCE or CKEDITOR, it does not solve the problem of the Chinese name File. either the upload fails or the Chinese name is uploaded and cannot be accessed by the web. In contrast, JCE is more user-friendly. for example, whether the file is JCE or CKEDITOR, it does not solve the problem of the Chinese name File. either the upload fails or the Chinese name is uploaded and 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. you do not need to search for the uploaded file in a small pop-up window. The source code of JCE is studied, and the method of saving the file name is changed. pure numbers are used as the file name.

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

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 '));


Change

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 location of the changes may vary slightly.

Bytes. In contrast, JCE is more user-friendly, such as files...

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.