Joomla JCE Editor to solve the problem of uploading Chinese name file Failure _php Tutorial

Source: Internet
Author: User
Either JCE or CKEditor, did not solve the problem of Chinese name file, either upload failed, or passed the Chinese name can not be accessed by the Web. In contrast, JCE is more user-friendly, such as file upload is selected by default, do not need users in such a small pop-up window to search the file just uploaded. Study the next JCE source code, change the way to save the file name, using pure numbers as the file name.

To the Joomla installation directory, locate components/com_jce/editor/extensions/browser/file.php, modify the 1017-1020 line:
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 '));

Change into
Copy CodeThe code is as follows:
$name = Date (' ymd-his-', Time ()). rand (999);

My Joomla version is 1.5, JCE version 2.1.3, different versions of the modified location may be slightly different.

http://www.bkjia.com/PHPjc/327590.html www.bkjia.com true http://www.bkjia.com/PHPjc/327590.html techarticle Either JCE or CKEditor, did not solve the problem of Chinese name file, either upload failed, or passed the Chinese name can not be accessed by the Web. In contrast, JCE is more user-friendly, such as documents ...

  • 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.