Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Zip library - Large file processing

$
0
0
Hi,

I am trying to create a zip file of various images. This works fine when there are a few images (size wise) but when the size of the total images exceeds a certain amount I get "Memory Allocation" errors. I am aware I can increase the server memory limit, but I am looking for a solution that does not require this.

Perhaps there is a way to split the files into multiple zip files and download them?

Controller
Code:
$this->load->model('project_model');
$this->load->library('zip');

$cat_name = $this->project_model->get_name();
$zipname = $cat_name->name;
$zipname = $zipname . '.zip';        

$path = 'images/';
$images = $this->project_model->get_gallery();
        
foreach($images as $row){
    $files = $path.$row['img_name'];
    $this->zip->read_file($files);
}        
       
$this->zip->download($zipname);

Any ideas? Thank you  Smile

Viewing all articles
Browse latest Browse all 14343

Trending Articles