Joomla jce editor solves the problem of uploading a Chinese name file

Source: Internet
Author: User

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, 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:Copy codeThe 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 '));

ChangeCopy codeThe 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.

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.