duancong2965 2009-10-23 19:15
浏览 29
已采纳

move_uploaded_file不支持utf8文件名

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?

  • 写回答

1条回答 默认 最新

  • douren2395 2009-10-23 19:32
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大