dongpiao1983 2014-01-19 10:54
浏览 13
已采纳

提取存储在用户帐户中的zip文件

Is it possible to extract a zip file stored in server using php file operations. The zip file has to be unzipped, I know the location of the file inside server so how can the file will be used for the process. Note- Users don't upload any data they just gives the different textual information which is stored as a zip file and it cannot be used to store in database.

Edit1-can we give html's input tag a DEFAULT PATH of file which has to be uploaded so user will not have to select a file they will just need to press upload button

  • 写回答

1条回答 默认 最新

  • dongqing4774 2014-01-19 11:20
    关注
    $zip = new ZipArchive;
    
    $res = $zip->open('file.zip');
    
    if ($res === TRUE) 
    {
        $zip->extractTo('/extract_path/');
        $zip->close();
    } 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?