Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Downloaded ZIP are always corrupted  (Read 4049 times)

0 Members and 1 Guest are viewing this topic.

demix

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Downloaded ZIP are always corrupted
« 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
« Last Edit: June 11, 2005, 04:54:38 pm by kegobeer »
Logged

demix.cpp

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Downloaded ZIP are always corrupted
« Reply #1 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Downloaded ZIP are always corrupted
« Reply #2 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.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Pharkie

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Downloaded ZIP are always corrupted
« Reply #3 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?
Logged

Pharkie

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Downloaded ZIP are always corrupted
« Reply #4 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
Logged

Megachip

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Downloaded ZIP are always corrupted
« Reply #5 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.
Logged

henfri

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Downloaded ZIP are always corrupted
« Reply #6 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
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.