PHP5 ZIP Errors PHP5 ZIP Errors
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

PHP5 ZIP Errors

Started by deltafun, January 11, 2006, 11:15:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deltafun

Hi,

I am having a single problem with cpg1.4.3 and PHP 5.0.3.

The "Download Favourites as ZIP" goes a little wrong it seems.

The ZIP file is downloaded correctly, and opens correctly, and it contains the correct filenames at the rights sizes. However when I try to decompress the images with winzip I get the following error:

Error:  invalid compressed data to inflate

If I switch back to php4, then everything works fine.

Also if I change "zipdownload.php" to be:
$zip = new [b]tar[/b]file($cwd,$flags);
$zip->addfiles($filelist);
$zip->filedownload('pictures.[b]tar[/b]');


Rather than the orig:

$zip = new zipfile($cwd,$flags);
$zip->addfiles($filelist);
$zip->filedownload('pictures.zip');


Then a tar file successfully downloads, opens and the contents can be extracted with no problems.

I have got a few other people to open the zip file as well with the same result.

One of them ( late last night ) told me that "the zip file was not a zip file but a tar file as it has no header information".

You can download a copy of the zip file from http://www.skgnet.com/pictures.zip

Hope someone can help as i`m really stumped.

Regards

David

deltafun

The solution to this turned out to the the obvious :(

I needed to enable zlib in my php.ini, as it was not by default on my host, but is by default in the php4 version they run. So when I was switching between them the issues occured, leading to confusion.

It appears that with zlib not enabled then the download zip scripts default to creating tar files, but still naming it a zip file.

Its just a bit different to GD2/Imagemagick etc where coppermine tells you that they are not available, and kind of odd in that the zip file is created even though the required library to do so does not exist.