Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: PHP5 ZIP Errors  (Read 2682 times)

0 Members and 1 Guest are viewing this topic.

deltafun

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
PHP5 ZIP Errors
« on: January 11, 2006, 11:15:55 am »

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:
Code: [Select]
$zip = new [b]tar[/b]file($cwd,$flags);
$zip->addfiles($filelist);
$zip->filedownload('pictures.[b]tar[/b]');

Rather than the orig:

Code: [Select]
$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
« Last Edit: January 18, 2006, 12:17:59 am by GauGau »
Logged

deltafun

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: PHP5 ZIP Errors
« Reply #1 on: January 17, 2006, 04:47:02 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.094 seconds with 19 queries.