Joomla JCE Editor to solve the problem of uploading Chinese name file failure _php Skills

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

To Joomla installed directory, find components/com_jce/editor/extensions/browser/file.php, modify 1017-1020 lines:
Copy Code code 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 Code code 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 somewhat different.

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.