开发者

move_uploaded_file does not support utf8 file name

开发者 https://www.devze.com 2022-12-09 02:16 出处:网络
I am using uploadify and the file name retrieved from $_FILES[\"fileData\"][\"name\"] on server side is in utf8. It may contain chinese or japanese characters. After the following codes run,

I am using uploadify and the file name retrieved from $_FILES["fileData"]["name"] on server side is in utf8. It may contain chinese or japanese characters. After the following codes run,

$tempFileWithPath = $_FILES['Filedata']['tmp_name'];
$destFile = $_FILES['Filedata']['name'];

$destFileWithPath=myUtility::getFileRepositoryPath().'/'.$destFile;
move_uploaded_file($tempFileWithPath,$destFileWithPath);

For those files using chinese or japanese file name, I used filezilla ftp client (which supports utf8 file name) and browser the folder and found that they all become ?????. Of course, other files 开发者_高级运维using english-only file name do not have this problem.

I am using php 5.2.9 and the server is linux on a shared hosting.

Is it true that all file-related functions in PHP have problems supporting utf8? Or my problem is related to other issues?


The target filesystem has to support the encoding as well - this may have nothing to do with uploadify or PHP at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消