doubishi8303 2013-07-22 06:23
浏览 39
已采纳

php为具有unicode名称的文件创建zip文件

In my php app I did the following:

$dn = sys_get_temp_dir() . '/' . uniqid('td', false);
if (mkdir($dn) === true)
{
    $fn = $dn . '/' . '関連事業調査.xls';
    $writer = new \PHPExcel_Writer_Excel5($wb);
    $writer->save($fn);

    $fzip = sys_get_temp_dir() . '/' . uniqid('td', false) . '.zip';
    $password = $this->container->getParameter('ZipPassword');
    $out = null; 
    $ret = null;
    exec("zip -qjP $password $fzip $dn" . '/*', &$out, &$ret);
}

In linux environment it correctly creates zip file with given password. I can unzip the files in Linux without any problem. But if I download it to Windows, and extract the files, file names become incorrect. How to solve this problem?

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 blender python输出纹理坐标(像素级)与三维坐标的对应关系
      • ¥15 python文件分发
      • ¥15 关于#c语言#的问题:要求:输出格式要界面直观、清晰大方、格式规范
      • ¥15 计算机组成汇编语言电路升级
      • ¥15 如何使用代理服务器没法改回来了?
      • ¥15 hadoop网站点击流数据分析项目
      • ¥15 TDA4 USB 识别不到的问题
      • ¥36 禁用ssl重协商以达到解决DOS漏洞
      • ¥20 cad 编写网表完成以下问题
      • ¥15 materials studio软件的forcite模块