PHP Unzip very large file

前端 未结 3 1662
情话喂你
情话喂你 2021-01-14 02:14

I have a zip file on the server. It\'s 1.1gb made up of thousands of small files. I do not have shell or root access to the server and can only use ftp and create php files

相关标签:
3条回答
  • 2021-01-14 02:25

    For a pure PHP solution, try PclZip - this would not require you to install any PHP extensions or require shell access - you just need to write access to wherever you want to extract the files.

    0 讨论(0)
  • 2021-01-14 02:42

    Thanks for the suggestions everyone. I ended up modifying the code in this question to unzip the files.

    Unzip a file with php

    0 讨论(0)
  • 2021-01-14 02:52
    $filename = '/media/file.gz';
    
    $unzipped_content = '';   
    $zd = gzopen($filename, "r");
    while ($zip_file = gzread($zd, 10000000)){
        $unzipped_content.= $zip_file;
    }
    gzclose($zd);
    
    echo $unzipped_content;
    
    0 讨论(0)
提交回复
热议问题