Question

I need to do an aplication to makes the user download a lot of pictures in the server choosing some criterias and only in one archive. i tried with php and pclzip.lib and zipstream libraries found on web, but none of the two methods work. with pclzip i only can compress 3Mb and with zipstream library in the middle of the download it fails with a 25MB size. I don´t know how many archives the user will need to download but now i have around 700 archives and 75MB. Is there another way to make this application work or has anyone had similar problems with this libraries and solved it. Here's some more specifications: remote server iis, php. thanks and sorry for my english

Was it helpful?

Solution

After some time I've found the way using

 ini_set('max_execution_time', 1200);
 ini_set("memory_limit","500M");

And the library ZipStream. Also, I've changed the PHP memory limit in the PHP server because my file is really big.

OTHER TIPS

I've used pclzip before and this code works:

if ($this->extension == 'zip') {
    $this->archive = new PclZip($orgPath);

    if ($this->archive->extract(PCLZIP_OPT_PATH, $newPath) == 0) {
        die("Error : " . $this->archive->errorInfo(true));
    }
}

But I think that's not your problem. It sounds like not enough RAM for PHP or not enough time.

If that's your problem, you can fix it with

set_time_limit(0);   // 0 = no time limit
ini_set('memory_limit', '300M');  // Increases memory for PHP to 300M

That works for me on Apache (I'm not shure, but does ini_set Work on your system?)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top