PHP fck folder and upload pictures in Chinese garbled problem solving method

Source: Internet
Author: User
PHP fck folder and upload pictures in Chinese garbled problem solving method

The main reason is FCK in the compilation ( Utf-8 ) code and local code (GBK) The ring tightness is caused, modify the following 5 files can be resolved.

Solve the Chinese folder garbled problem:

file 1 : \fckeditor\editor\filemanager\browser\default\browser.html

Found it

Oconnector.sendcommand = function (command, params, callbackfunction)

{

?????? var sURL = this. Connectorurl + ' command= ' + Command;

?????? sURL + = ' &type= ' + this. ResourceType;

//???? sURL + = ' &currentfolder= ' + encodeuricomponent (this. CurrentFolder);

?????? sURL + = ' &currentfolder= ' +? This. CurrentFolder; ?

?

?????? if (params) sURL + = ' & ' + params;

?

?????? Add a random salt to avoid getting a cached version of the command execution

?????? sURL + = ' &uuid= ' + new Date (). GetTime ();

?

?????? var oxml = new Fckxml ();

?

?????? if (callbackfunction)

????????????? Oxml.loadurl (sURL, callbackfunction); ?? Asynchronous load.

?????? Else

????????????? Return Oxml.loadurl (sURL);

?

?????? return null;

}

Remove encodeURIComponent function.

?

file 2 : \fckeditor\editor\filemanager\browser\default\frmcreatefolder.html

Found it

function CreateFolder ()

{

?????? var sfoldername;

?

?????? while (true)

?????? {

????????????? Sfoldername = Prompt (' Type The name of the new folder: ', ');

?

????????????? if (Sfoldername = = null)

???????????????????? return;

????????????? else if (sfoldername.length = = 0)

???????????????????? Alert (' Please type the folder name ');

????????????? Else

???????????????????? break;

?????? }

?

//???? Oconnector.sendcommand (' CreateFolder ', ' newfoldername= ' + encodeuricomponent (sfoldername), CreateFolderCallBack);

?????? Oconnector.sendcommand (' CreateFolder ', ' newfoldername= ' + sfoldername, createfoldercallback);

}

Remove encodeURIComponent function.

?

file 3 : \fckeditor\editor\filemanager\browser\default\frmresourceslist.html

Found it

function OpenFile (FILEURL)

{

//???? WINDOW.TOP.OPENER.SETURL (encodeURI (FILEURL). replace (' # ', '%23 '));

?????? WINDOW.TOP.OPENER.SETURL (FILEURL);

?????? Window.top.close ();

?????? Window.top.opener.focus ();

}

Remove encodeURI function.

?

Solve the problem of uploading pictures in Chinese file name garbled:

file 4 : \fckeditor\editor\filemanager\connectors\php\commands.php

Found it

function FileUpload ($resourceType, $currentFolder, $sCommand) {

。。。

? ??? Find

? ??? Move_uploaded_file ($oFile [' Tmp_name '], $sFilePath);

Move_uploaded_file ($oFile [' Tmp_name '], Iconv ("Utf-8", "GBK", $sFilePath));

}

to the file name $sFilePath transcoding.

?

file 5 : \fckeditor\editor\filemanager\connectors\php\util.php

Found it

function Converttoxmlattribute ($value) {

?????? .....

?????? Find

? ???? Return (Utf8_encode (Htmlspecialchars ($value)));

?????? return Iconv ("GBK", "UTF-8", Htmlspecialchars ($value));

}

Transcode the content.

?

The original blog has mentioned the relevant issues: http://simpledev.iteye.com/blog/371619

(see: Attachments directly overwrite files)

Finishing 120521 15:06

?

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