服务器端不能用这个,php有无实现方法,既然有能新建zip文件的,为何没有修改zip的呢?

解决方案 »

  1.   

    加一个zip模块进去
    使用方式如下:
    <?php$zip = new ZipArchive();
    $filename = "./test112.zip";if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
        exit("cannot open <$filename>\n");
    }$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
    $zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
    $zip->addFile($thisdir . "/too.php","/testfromfile.php");
    echo "numfiles: " . $zip->numFiles . "\n";
    echo "status:" . $zip->status . "\n";
    $zip->close();
    ?> 
      

  2.   

    别试了,回答者请看清楚我的问题,我不是要重新生成一个新的zip,而是需要修改一个zip文件往里面增加一些文件。至于那个zip文件为何不能解压我也说明一下,那个zip文件是在linux系统里面压缩生成的,里面相同路径下包含有大小写同名的文件比如a.dat,A.dat,因此,这个zip文件在windows系统中解压是会自我覆盖的。寻求能看懂问题的高手解答我的问题,1000分相送