我想在分割的zip文件中压缩一个大文件夹。我使用了经典的codeigniter代码,我想使用popen
或stream
,但我不知道该怎么做。我希望有人帮助我。
我的代码是:
public function exportar_pastas() {
ini_set('max_execution_time', 4600);
ini_set('memory_limit','7024M');
$username="";
if($_POST){
$this->load->library('zip');
$user = $this->input->post("nome");
$users = $this->user_model->get_users();
foreach($users as $userm){
if($userm->user_id == $user){
$username = $userm->username;
}
}
$path = "../certificados/".$username;
$this->zip->read_dir($path);
$handle = $this->zip->download('my_backup.zip');
while (!feof($handle)){
echo fread($handle, 8000);
flush();
}
redirect(base_url().'admin/backup');
}else{
$this->load->view('admin/backup');
}
}