forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: demix on April 17, 2005, 06:08:15 pm

Title: Downloaded ZIP are always corrupted
Post by: demix on April 17, 2005, 06:08:15 pm
Hi. First of all, sorry for my bad english.

This is my problem: when I download the zip from "My Bookmark" (zipdownload.php) the server send me a corrupted zip.
I cannot open it with unzip, file-roller, WinZip, WinRAR and Windows XP Native Zip utility.
I make the following tests:

1) I add this line in zipdownload.php
$zip->filewrite(/tmp/file_generated.zip)
and I tested this generated file: it is corrupted in the server (not during the transfer).

2) The Tar compression works well: if I change zipdownload.php
$zip = new zipfile($cwd,$flags);
in
$zip = new tarfile($cwd,$flags);
the tar archive downloaded is ok. But Windows users bugs me that they don't know how to extract tar files :( So I would like zip compression to work.

3) I made an archive with only one file (safran.jpg) that is present in Coppermine Online Demo to HEX compare the corrupted generated zip with the correct zip generated from Official Coppermine online demo. The files are totally different. I attach to this post the two files. I downloaded correct.zip from Official Coppermine site, corrupt.zip from my site.

4) zlib of corse is installed.

The server configuration is:

SuSE Linux 8.2
Coppermine 1.3.2
zlib-1.1.4-105
php-4.3.1-52
apache-1.3.27-82

I have the same problem with another server:

SuSE Linux 9.1
Coppermine 1.3.2
php4-zlib-4.3.9-0.1
zlib-1.2.1-70.6
php-4.3.9-0.1
apache-2.0.52-5.1

If someone needs it, I can give the URL of the site, and a free shell account to the server to see php source files.

Thanks in advance.

Palma Demis
Title: Re: Downloaded ZIP are always corrupted
Post by: demix.cpp on June 11, 2005, 01:02:03 pm
I finally solved by myself.

In /etc/php.ini I changed the value

mbstring.func_overload = 7
in
mbstring.func_overload = 0

Now it works fine.
Title: Re: Downloaded ZIP are always corrupted
Post by: kegobeer on June 11, 2005, 04:54:28 pm
Thanks for reporting your fix.  This is one of the few issues the devs didn't have an answer for.
Title: Re: Downloaded ZIP are always corrupted
Post by: Pharkie on June 15, 2005, 12:22:23 pm
I have exactly the same problem, and changing mbstring.func_overload doesn't help - I've tried it both 0 and 7, in php.ini and just on the relevant site.

Are there any other clues to what's going wrong with the ZIP download? Every one it creates is unopenable, saying it's 'invalid or corrupted'.

I tried replacing zipdownload.php in my CPG 1.3.2 with the version 1.5. from CPG 1.3.3, but that makes no difference. I don't want to upgrade everything to 1.3.3 if it's not going to fix the problem?

What do people think - is there a simple (probably PHP config related) answer to this issue with the ZIP file?
Title: Re: Downloaded ZIP are always corrupted
Post by: Pharkie on June 15, 2005, 01:43:19 pm
Got it!  ::)

In the CPG web-admin config I needed to change 'English-UTF-8' to just 'English'.

I now realise this also prevented xp_publish.php from working, a problem I hadn't resolved previously. i.e. the download .reg file was generated properly, but wouldn't go into the registry despite looking exactly the same in a text editor to one that did.

I suspect in 'UTF-8' mode, CPG is adding stuff into headers or generating ASCII parts that stop the downloaded ZIP or REG from working.

Note you can't just copy 'english-utf-8.php' to 'english.php' in the lang files, which I wanted to do to quickly keep my text changes. you need to re-make the changes to english.php. The utf-8 file must actually have utf-8 characters in it, which means you're best starting from the clean 'english.php'. I managed to speed this up using Beyond Compare 2.

Hope this helps someone!  ;D

yay my CPG is working again =:)!

Adam
Title: Re: Downloaded ZIP are always corrupted
Post by: Megachip on August 09, 2005, 08:30:27 pm
I finally solved by myself.

In /etc/php.ini I changed the value

mbstring.func_overload = 7
in
mbstring.func_overload = 0

Now it works fine.

That doesn't work for me, but deactivate mbstring module works.
Title: Re: Downloaded ZIP are always corrupted
Post by: henfri on September 11, 2005, 10:40:26 am
Hi,
I'm experiencing the same Problems. As the site is hostet by a Provider, I can't access the  /etc/php.in.
Here's some Info about the environment:

Code: [Select]
System SunOS cadmium 5.9 Generic_112233-08 sun4u
Build Date Aug 12 2005 16:11:28
Configure Command './configure' '--with-ssl=/opt/rz/openssl-0.9.7d' '--with-ndbm' '--with-db' '--with-mysql' '--with-ftp' '--with-gettext' '--with-gd=/usr/local' '--with-zlib-dir=/usr/include' '--enable-safe-mode' '--enable-memory-limit' '--with-apxs=/opt/rz/apache-1.3.31/bin/apxs' '--prefix=/opt/rz/php-4.3.11'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /opt/rz/php-4.3.11/lib
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.zlib

zlib
ZLib Support enabled
Compiled Version 1.2.3
Linked Version 1.2.3

Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value

Any Ideas, what could be wrong?

Thanks a lot,
Hendrik